More information!
I put in a new feature request in Jira, but actually, the functionality already exists. To quote Christian...
Message:
The following issue has been closed.
Resolver: Christian Bauer
Date: Wed, 30 Jun 2004 8:59 AM
This functionality already exists, use the "foreign-key" attribute on <one-to-one>, <many-to-one>, <key>, and <many-to-many> mapping elements. Note that inverse="true" sides will not be used, only the non-inverse side will be looked at for the constraint names.
So, I tried this out, but version 1.2 of XDoclet doesn't support the foreign-key tags, only 1.2.1 of XDoclet.
I must also say that I'm very impressed with the way that XDoclet generates the mapping documents in that it respects inheritance properly.
In my situation I have a many-to-one relationship defined in a superclass, but I can still name the foreign-key constraint in the subclass, simply by overriding the method to just call the superclass method, but providing the @hibernate.many-to-one foreign-key="fk..." tag in the subclass. Very nice!
Well done XDoclet and Hibernate!
|