hibernate is on git now, make a pull request - it's not as trivial as you think ;)
its easy to make things unique - but you also need it to be deterministic across clusters and what not...
/max
philip.j.r.jones wrote:
This issue is actually badly named. The problem described in the original post is that the foreign key constraint name is too long, not the foreign key column name. The foreign key column name length can be controlled using the pluggable naming strategy or by explicitly setting the foreign key name using annotations. The foreign key constraint however is not configurable as far as I can see (beyond specifying the prefix, as described by the original poster). It certainly does not appear on the org.hibernate.cfg.NamingStrategy interface, unless I am missing something.
So, the replies suggesting "provide foreignkey names explicitly" or "You can anyway specify manually the foreign key" do not address this bug unfortunately.
... Which is a long way of saying that this is a real bug in Hibernate and I vote for a fix! It's currently causing me a problem too, precisely as described in the original post.
(Hibernate version 3.0.5.RELEASE, Oracle 11)
P.S. I think the whole problem of Hibernate generated identifiers being too long for Oracle "out of the box" needs fixing - there is really no need at all for constraint names or index names to be more than 30 characters to achieve uniqueness. I am happy to look for a solution, even submit a patch, so I'm not just telling other people to do some work for me ;-), however as I am relatively new to Hibernate, someone with years on the project might be better suited.