All,
Using the Middlegen/Hib Plugin I'd like to generate a one-to-many mapping where the "one" side of the mapping simply uses the foreign key value rather than the object referenced by the foreign key.
So in the Midgen/Hib generated-prefs.properties file:
In the tables section:
hibernate.tables.tableB.columns.tableA_id.java-name=tableAId
hibernate.tables.tableB.columns.tableA_id.java-type=int
In the relations section:
relations.tableB-tableA.tableA-has-tableB.enabled=true
relations.tableB-tableA.tableA-has-tableB.target-many=false
So for the generated object representing "tableA" which is the "one" side of the one-to-many, this is generated:
private com.my.package.name.TableB tableB; // the object
What I would like to accomplish is this (ie, use the key itself rather than the obj):
private int tableBId; // the int table id
Any suggestions?
Thanks,
Steve
|