In Hibernate, I modified the class Dialect.java, now
Foreign Key stays less than 30 characters and recompile the
hibernate3.jar, put in the project and had everything OK right now.
1 person found this helpful
This is a limitation in the current implementation which I just ran in to today as well. We do not let Hibernate default the foreign key name because we need to be consistent to remove the constrains when you want to drop and create or update the tables.
I have added support for two new DMS annotations on the data property that will allow you to specify the names of the key and the inverse key (if necessary). Unfortunately this wont be available till the next release of LCDS, sometime around the middle of this year (2011). In the mean time, generating the Java source files and hand editing the @ForeignKey annotation is the work around.
Sorry for the inconvenience.
Ok, in mean while, i replaced the lib of hibernate to generate a shorter name in
foreign key. it seems work, no problems since that.
Waiting the new version.
Sorry for my poor english.
I believe I hit the same issue yesterday in letting hibernate generate the join tables between to long winded tables, I shortened the tables as a work around
I tried that in first, but the joins and primary keys of my tables was generating
too long names to the foreign keys.
In the end, I had tables with six characters in name.