We're updating the issue view to help you get more done. 

PluralAttribute#isAssociation returns true for @ElementCollection

Description

the method is implemented to always return true:

org.hibernate.jpa.internal.metamodel.PluralAttributeImpl

1 2 3 4 @Override public boolean isAssociation() { return true; }

but it should be:

org.hibernate.jpa.internal.metamodel.PluralAttributeImpl

1 2 3 4 5 @Override public boolean isAssociation() { return getPersistentAttributeType() == PersistentAttributeType.ONE_TO_MANY || getPersistentAttributeType() == PersistentAttributeType.MANY_TO_MANY; }

to exclude @ElementCollection attributes, which are NOT associations in terms of entity model, just like @Embedded attributes are not associations for SingularAttribute

Environment

Hibernate 5.0.7 shipped with Wildfly 10.0.0.Final

Status

Assignee

Gail Badner

Reporter

Michele Mariotti

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.0.7

Priority

Minor