JPA association without foreign key

后端 未结 3 644
孤城傲影
孤城傲影 2020-12-28 11:43

Is it possible to set up a ManyToOne association without JPA creating a foreign key in the database?

The tables are owned by another system and are populated asynchr

3条回答
  •  盖世英雄少女心
    2020-12-28 12:10

    In Hibernate 4.3.X annotation field with @org.hibernate.annotations.ForeignKey( name = "none") worked for me.

    But be carefull: in case of bidirectional relationships, you have to annotate two fields by mentionad annotation!!!

提交回复
热议问题