ignoring collections and maps of any during populating JPA metamodel,

see HHH-6589
This commit is contained in:
Jan Šimek 2013-02-20 10:34:07 +01:00 committed by Brett Meyer
parent 1948fa97dc
commit 5924a1b8c0
1 changed files with 14 additions and 2 deletions

View File

@ -479,7 +479,12 @@ public class AttributeFactory {
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,7 +505,14 @@ public class AttributeFactory {
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 (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;