Hi Emmanuel,
I just was happy that I got the problem solved but get stuck in a followup problem. I've added the referencedColumnName for every ManyToOne/OneToMany relation by using the same name as the key property but get an hibernate configuration error now since some foreign key columns are renamed to a different name in the database.
E.g.
org_country_key references
country_key
Code:
@JoinColumns( {
@JoinColumn(name="org_country_key",
referencedColumnName="country_key", unique=false,
nullable=false, insertable=false, updatable=false),
@JoinColumn(name="client_key",
referencedColumnName="client_key", unique=false, nullable=false,
insertable=false, updatable=false) } )
Is there a way on how to get the columnName of the referencedColumn within the Ejb3PropertyGetAnnotation.ftl template since I don't want to change the hibernate Java sources for this issue?
I can't find anything on org.hibernate.mapping.Column.
Best
Meinolf
P.S: I tried to use jdk 1.5_09 but doesn't help either. Regarding the order of the @Id columns they are all fine for those objects that were involved in that test method. All sources are generated and not change. Hibernate Tools does generate a fine order of the annotations and the SQL at runtime is fine as well. Only the binding order is wrong when the referencedColumnName attribute is not defined. Must be a side effect in my project with other non involved fk references.