Skip to content

Commit 5924a1b

Browse files
Jan Šimekbrmeyer
authored andcommitted
ignoring collections and maps of any during populating JPA metamodel,
see HHH-6589
1 parent 1948fa9 commit 5924a1b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

hibernate-entitymanager/src/main/java/org/hibernate/ejb/metamodel/AttributeFactory.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,12 @@ else if ( type.isAssociationType() ) {
479479
final Attribute.PersistentAttributeType elementPersistentAttributeType;
480480
final Attribute.PersistentAttributeType persistentAttributeType;
481481
if (elementType.isAnyType()) {
482-
throw new UnsupportedOperationException("collection of any not supported yet");
482+
if ( context.isIgnoreUnsupported() ) {
483+
return null;
484+
}
485+
else {
486+
throw new UnsupportedOperationException("collection of any not supported yet");
487+
}
483488
}
484489
final boolean isManyToMany = isManyToMany(member);
485490
if (elementValue instanceof Component) {
@@ -500,7 +505,14 @@ else if ( type.isAssociationType() ) {
500505
final Value keyValue = ((Map)value).getIndex();
501506
final org.hibernate.type.Type keyType = keyValue.getType();
502507

503-
if (keyType.isAnyType()) throw new UnsupportedOperationException("collection of any not supported yet");
508+
if (keyType.isAnyType()) {
509+
if ( context.isIgnoreUnsupported() ) {
510+
return null;
511+
}
512+
else {
513+
throw new UnsupportedOperationException("collection of any not supported yet");
514+
}
515+
}
504516
if (keyValue instanceof Component) keyPersistentAttributeType = Attribute.PersistentAttributeType.EMBEDDED;
505517
else if (keyType.isAssociationType()) keyPersistentAttributeType = Attribute.PersistentAttributeType.MANY_TO_ONE;
506518
else keyPersistentAttributeType = Attribute.PersistentAttributeType.BASIC;

0 commit comments

Comments
 (0)