Expand my Community achievements bar.

ForeignKey name too long + oracle

Avatar

Level 1

Hello

I am using the Flex plugin for modeling tables build my application. But when I deploy thedatabase, some errors occur with the names of foreign key, with more than 30characters (very annoying, this limitation of Oracle).

If I can set the name of FK using the notation (like hibernate), which is solved all myproblems, but the FML file does not seem to take.

Has anyone tried it? Is this possible?

Another attempt is to change "org.hibernate.dialect.Oracle10gDialect"for my ownimplementation, but I'm still studying it.

Thanks.

5 Replies

Avatar

Level 1

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.

Avatar

Employee

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.

Tom

LCDS

Avatar

Level 1

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.

Avatar

Former Community Member

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

Avatar

Level 1

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.

thanks