Uploaded image for project: 'Hibernate ORM'
  1. HHH-10888

PluralAttribute#isAssociation returns true for @ElementCollection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.7
    • Fix Version/s: 5.0.10, 5.2.2, 5.1.1
    • Component/s: metamodel
    • Labels:
      None
    • Environment:
      Hibernate 5.0.7 shipped with Wildfly 10.0.0.Final
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      the method is implemented to always return true:

      org.hibernate.jpa.internal.metamodel.PluralAttributeImpl
      @Override
      public boolean isAssociation() {
      	return true;
      }
      

      but it should be:

      org.hibernate.jpa.internal.metamodel.PluralAttributeImpl
      @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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: