# Hibernate 5 auto-ddl index for column in embeddable object create index on all columns

**URL:** <https://discourse.hibernate.org/t/hibernate-5-auto-ddl-index-for-column-in-embeddable-object-create-index-on-all-columns/953>\
**Category:** Hibernate ORM\
**Created:** [June 21, 2018, 3:00pm UTC](https://discourse.hibernate.org/t/hibernate-5-auto-ddl-index-for-column-in-embeddable-object-create-index-on-all-columns/953 "2018-06-21T15:00:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleksii\_Miroshnyk](https://avatars.discourse-cdn.com/v4/letter/o/94ad74/32.png) [@Oleksii\_Miroshnyk](https://discourse.hibernate.org/u/Oleksii_Miroshnyk)\
**Post date:** [June 21, 2018, 3:00pm UTC](https://discourse.hibernate.org/t/hibernate-5-auto-ddl-index-for-column-in-embeddable-object-create-index-on-all-columns/953/1 "2018-06-21T15:00:25Z")

</div>

updating project to 5.2.17 from 4.  
Have a very strange situation, let’s say I have a class A, it has some props and a column idxColumn with @Index annotation to add index to that column. Class A also has a property let’s say embeddable which is Embeddable of class B.  
Class B declares let’s say 7 columns, one of those columns let’s say EXPIRATION\_DATE has @Index annotation  
@Index(  
name = “IDX\_EXPIRATION\_DATE\_SEARCH”,  
columnNames = {“EXPIRATION\_DATE”}  
)

This results in attempt to create an index IDX\_EXPIRATION\_DATE\_SEARCH but for all columns in that embaddable object:

create index IDX\_EXPIRATION\_DATE\_SEARCH on BLC\_CUSTOMER\_PAYMENT (CARD\_TYPE, EXPIRATION\_DATE, LAST\_EXPIRATION\_NOTIFICATION, LAST\_FOUR, LAST\_PAYMENT\_STATUS, PAYMENT\_GATEWAY\_TYPE , PAYMENT\_NAME);

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [June 21, 2018, 8:18pm UTC](https://discourse.hibernate.org/t/hibernate-5-auto-ddl-index-for-column-in-embeddable-object-create-index-on-all-columns/953/2 "2018-06-21T20:18:52Z")

</div>

Try to create a test case that replicates the issue, as explained in [this article](http://in.relation.to/2018/06/04/best-way-write-hibernate-orm-issue-test-case/). Thanks.
