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

Table name generated for @ElementCollection uses owning entity class name instead of mapped entity name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.5, 4.2.14
    • Fix Version/s: 4.3.6, 4.2.15
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      If no collection table is specifically mapped and an entity name is specified (via @Entity(name="...") , the table name generated for @ElementCollection starts with its (unqualified) owning entity class name. It should start with the mapped entity name instead.

      For example:

      @Entity(name="Mtx")
      public class Matrix {
      	@Id
      	private Integer id;
      
      	@ElementCollection
      	private Set<Integer> mvalues = new HashSet<Integer>();
      }
      

      Currently, the collection table is named "Matrix_mvalues"; it should be "Mtx_mvalues".

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                gbadner Gail Badner
                Reporter:
                gbadner Gail Badner
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: