HHH-10888 : PluralAttribute#isAssociation returns true for @ElementCollection
(cherry picked from commit cdd7fb66c8
)
This commit is contained in:
parent
60e2123337
commit
81d211d12a
|
@ -146,7 +146,8 @@ public abstract class PluralAttributeImpl<X, C, E>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAssociation() {
|
public boolean isAssociation() {
|
||||||
return true;
|
return getPersistentAttributeType() == PersistentAttributeType.ONE_TO_MANY
|
||||||
|
|| getPersistentAttributeType() == PersistentAttributeType.MANY_TO_MANY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -277,7 +277,7 @@ public class MetadataTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
final EntityType<House> entityType = entityManagerFactory().getMetamodel().entity( House.class );
|
final EntityType<House> entityType = entityManagerFactory().getMetamodel().entity( House.class );
|
||||||
final SetAttribute<House,Room> rooms = entityType.getDeclaredSet( "rooms", Room.class );
|
final SetAttribute<House,Room> rooms = entityType.getDeclaredSet( "rooms", Room.class );
|
||||||
assertNotNull( rooms );
|
assertNotNull( rooms );
|
||||||
assertTrue( rooms.isAssociation() );
|
assertFalse( rooms.isAssociation() );
|
||||||
assertTrue( rooms.isCollection() );
|
assertTrue( rooms.isCollection() );
|
||||||
assertEquals( Attribute.PersistentAttributeType.ELEMENT_COLLECTION, rooms.getPersistentAttributeType() );
|
assertEquals( Attribute.PersistentAttributeType.ELEMENT_COLLECTION, rooms.getPersistentAttributeType() );
|
||||||
assertEquals( Room.class, rooms.getBindableJavaType() );
|
assertEquals( Room.class, rooms.getBindableJavaType() );
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class StaticMetadataTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
assertFalse( House_.address.isCollection() );
|
assertFalse( House_.address.isCollection() );
|
||||||
assertFalse( House_.address.isAssociation() );
|
assertFalse( House_.address.isAssociation() );
|
||||||
assertNotNull( House_.rooms );
|
assertNotNull( House_.rooms );
|
||||||
assertTrue( House_.rooms.isAssociation() );
|
assertFalse( House_.rooms.isAssociation() );
|
||||||
assertTrue( House_.rooms.isCollection() );
|
assertTrue( House_.rooms.isCollection() );
|
||||||
assertEquals( Attribute.PersistentAttributeType.ELEMENT_COLLECTION, House_.rooms.getPersistentAttributeType() );
|
assertEquals( Attribute.PersistentAttributeType.ELEMENT_COLLECTION, House_.rooms.getPersistentAttributeType() );
|
||||||
assertEquals( Room.class, House_.rooms.getBindableJavaType() );
|
assertEquals( Room.class, House_.rooms.getBindableJavaType() );
|
||||||
|
|
Loading…
Reference in New Issue