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