Beginner |
|
Joined: Wed Mar 16, 2005 4:07 pm Posts: 22
|
I am using 3.1.0alpha5 hibernate-tools. when trying to use hbm2java to generate POJOs, one of the mapping file has a composite id as the following:
<hibernate-mapping package="foo.bar">
<class name="LoanBillingHistory" table="LoanBillingHistory">
<composite-id class="LoanBillingHistoryPK" name="Id">
<key-many-to-one
class="LoanBill"
column="LoanBillID"
name="LoanBillID"
/>
<key-property
column="ProductBalanceID"
name="ProductBalanceID"
type="integer"
/>
</composite-id>
...
hbm2java throws the following exception. it appears that it's trying to find the component id class which is generated by itself, therefore not in the classpath.
org.hibernate.MappingException: component class not found: foo.bar.LoanBillingHistoryPK
at org.hibernate.mapping.Component.getComponentClass(Component.java:105)
at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:140)
at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)
at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:33)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:126)
at org.hibernate.mapping.Component.getType(Component.java:160)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:151)
at org.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:571)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:676)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:87)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:55)
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:39)
is there a way to fix it? (I could compile the generated classes and run the hbm2java again. but that's kind of ugly...)
also the class LoanBillingHistory and its composite id class LoanBillingHistoryPK seem to be generated. don't know what the exception implies?
thanks in advance.
|
|