Date 1 - 2 of 2
JPA @ManyToMany @ForeignKey name not used
I'm trying to specify foreign-key names. This helps to reduce the effort on db schema comparison at the end of development, to prepare the schema upgrade script.
Actually it works very well on most relationships but I can't find the solution for JoinTables.
Here is an example of User class containing a collection of Group
@JoinTable(name = "iam_user_groups",
The SchemaTool and DN doesn't seem to care about the foreignKey = @ForeignKey(name="fk_user_groups" and still generate iam_user_groups_fk1.
Am I wrong in the mapping definition or is it not yet supported by Datanucleus. (I haven't seen restriction in the JPA specification.)
You're wrong in the mapping definition. @JoinTable has foreignKey and inverseForeignKey.
Take it up with the people behind JPA why their definition of annotations are unintuitive ... but then you wont find anyone accountable for them, they ran away many years ago.
|1 - 2 of 2|