| I’m getting the same ERROR with 5.3.10.Final , 5.4.3.Final & 5.4.4.Final Can you turn on hibernate.show_sql=true and see/check the create table - You shouldn’t have to specify JoinColumns, it should be able to generate non conflicting column names for the join table. In fact they were erroneous and masking a bug (I think) in the defaults. Can you remove the JoinColumns annotations and you’ll need to drop the table first. I can see the unique key is getting generated incorrectly for me, as it just contains the columns from the owned side, which is totally wrong as I would expect the unique key (i.e primary key) to be the sum of the foriegn keys. Could be a regression as someone reported it years ago (https://stackoverflow.com/questions/24196239/jpa-2-0-hibernate-generates-incorrect-join-table-pk-for-onetomany-with-joint) I don’t know if it’s a problem with the dialect or with the provider. Also my entities have composite keys with IdClasses. 2019-09-06 12:23:51.379 INFO 17352 — [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.10.Final} 2019-09-06 12:23:51.389 INFO 17352 — [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2019-09-06 12:23:51.631 INFO 17352 — [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final} 2019-09-06 12:23:51.861 INFO 17352 — [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.Oracle12cDialect 2019-09-06 12:23:51.981 INFO 17352 — [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [byte[]] overrides previous : org.hibernate.type.BinaryType@2ffa91dc 2019-09-06 12:23:51.981 INFO 17352 — [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [[B] overrides previous : org.hibernate.type.BinaryType@2ffa91dc 2019-09-06 12:23:51.981 INFO 17352 — [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [Byte[]] overrides previous : org.hibernate.type.WrapperBinaryType@6de610c6 2019-09-06 12:23:51.981 INFO 17352 — [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [[Ljava.lang.Byte;] overrides previous : org.hibernate.type.WrapperBinaryType@6de610c6 Hibernate: create table Email_ROSTER_PRINCIPLE_SUMMARY (Email_employeeId varchar2(255 char) not null, Email_sendDate timestamp not null, Email_shiftDate date not null, Email_templateName varchar2(255 char) not null, summaries_EMPLOYEE_ID varchar2(255 char) not null, summaries_SHIFT_DATE date not null) Hibernate: alter table Email_ROSTER_PRINCIPLE_SUMMARY drop constraint UK_aieacubl3jlowfslhis2bt7qr Hibernate: alter table Email_ROSTER_PRINCIPLE_SUMMARY add constraint UK_aieacubl3jlowfslhis2bt7qr unique (summaries_EMPLOYEE_ID, summaries_SHIFT_DATE) Hibernate: alter table Email_ROSTER_PRINCIPLE_SUMMARY add constraint FKrd1sp7taeyu5l81co2gc4b924 foreign key (summaries_EMPLOYEE_ID, summaries_SHIFT_DATE) references ROSTER_PRINCIPLE_SUMMARY Hibernate: alter table Email_ROSTER_PRINCIPLE_SUMMARY add constraint FK3amduajjmw8ae2ddpe2mvjgyk foreign key (Email_employeeId, Email_sendDate, Email_shiftDate, Email_templateName) references Email |