Duplicate index name in generated DDL for @Embeddable types in Hibernate

Solution Verified - Updated -

Issue

  • An @Embeddable type is defined with a column index

    ...
    import org.hibernate.annotations.Index;
    ...
    @Embeddable
    public class Title implements Serializable {
        @Index(name = "title_idx")
        private String theTitle;
        ...
    }
    
  • The @Embeddable type is used in several entities (included via @Embedded)

  • When generating DDL, Hibernate attempts to create a database index with the same name (e.g. 'title_idx') for each entity

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 6
  • Hibernate 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content