I'm trying to reverse engineer (with annotations) a table with a composite id. I use:
<hibernatetool destdir="${gen.dst}">
<jdbcconfiguration packagename="com.umusic.ecrm.db.${db}"/>
<hbm2java ejb3="true"/>
</hibernatetool>
So it generates two classes: Whitelist and WhitelistId.
But the generated Whitelist class has this:
@Id(generate = GeneratorType.AUTO)
@Column(name = "cust_id")
@Column(name = "campaign_type_id")
public WhitelistId getId() {
return this.id;
}
which, of course, doesn't compile (duplicate Column). Questions:
1. Is there a way to make it work other than fixing the code manually?
2. If not, how do I fix it manually, i.e. can somebody provide a complete working example with annotated composite ids? I tried to follow the annothation manual, but it only has code excerpts and they don't work in my case. I get it to compile, but HQL queries fail.
Thanks a lot!
|