JPA association without foreign key

后端 未结 3 642
孤城傲影
孤城傲影 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 11:50

    Add name="none" in javax.persistence.ForeignKey,

    this worked for me.

    foreignKey = @javax.persistence.ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT)
    

提交回复
热议问题