ANN-855 implement @MapKeyClass

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17172 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2009-07-21 01:25:22 +00:00
parent d9a1022f34
commit 1cac641632
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import java.util.Map;
import java.util.Random;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.MapKeyClass;
import org.hibernate.AnnotationException;
import org.hibernate.AssertionFailure;
@ -141,6 +142,9 @@ public class MapBinder extends CollectionBinder {
if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) ) {
target = property.getAnnotation( org.hibernate.annotations.MapKey.class ).targetElement();
}
else if ( property.isAnnotationPresent( MapKeyClass.class ) ) {
target = property.getAnnotation( MapKeyClass.class ).value();
}
else if ( property.isAnnotationPresent( MapKeyManyToMany.class ) ) {
target = property.getAnnotation( MapKeyManyToMany.class ).targetEntity();
}

View File

@ -27,6 +27,7 @@ public class Brand {
@ElementCollection(targetClass = SizeImpl.class)
@MapKeyManyToMany(targetEntity = LuggageImpl.class)
//TODO @MapKeyClass(LuggageImpl.class)
private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage, Size>();