ignoring collections and maps of any during populating JPA metamodel,

see HHH-6589
Conflicts:
	hibernate-entitymanager/src/main/java/org/hibernate/ejb/metamodel/AttributeFactory.java
This commit is contained in:
Jan Šimek 2013-08-05 23:20:08 -04:00 committed by Brett Meyer
parent 96e80b2df3
commit 5255c5074f

View File

@ -479,7 +479,12 @@ else if ( type.isAssociationType() ) {
final Attribute.PersistentAttributeType elementPersistentAttributeType;
final Attribute.PersistentAttributeType persistentAttributeType;
if (elementType.isAnyType()) {
throw new UnsupportedOperationException("collection of any not supported yet");
if ( context.isIgnoreUnsupported() ) {
return null;
}
else {
throw new UnsupportedOperationException("collection of any not supported yet");
}
}
final boolean isManyToMany = isManyToMany(member);
if (elementValue instanceof Component) {
@ -500,8 +505,14 @@ else if ( type.isAssociationType() ) {
final Value keyValue = ((Map)value).getIndex();
final org.hibernate.type.Type keyType = keyValue.getType();
if (keyType.isAnyType()) throw new UnsupportedOperationException("collection of any not supported yet");
if (keyValue instanceof Component) keyPersistentAttributeType = Attribute.PersistentAttributeType.EMBEDDED;
if (keyType.isAnyType()) {
if ( context.isIgnoreUnsupported() ) {
return null;
}
else {
throw new UnsupportedOperationException("collection of any not supported yet");
}
} if (keyValue instanceof Component) keyPersistentAttributeType = Attribute.PersistentAttributeType.EMBEDDED;
else if (keyType.isAssociationType()) keyPersistentAttributeType = Attribute.PersistentAttributeType.MANY_TO_ONE;
else keyPersistentAttributeType = Attribute.PersistentAttributeType.BASIC;
} else keyPersistentAttributeType = null;