Joined: Thu Jan 12, 2006 9:41 am Posts: 15 Location: France
|
Hi!
I'm using Hibernate tools for reverse engineer the schema database.
I have a problem with the code generated.
<class name="A" table="A">
<composite-id name="id" class="AComposite">
<key-many-to-one name="b" class="B">
<column name="idB"/>
</key-many-to-one>
<key-property name="titi">
<column name="TITI"/>
</key-property>
</composite-id>
<property name="nameofproperty1">
<column name="PROPERTY1" />
</property>
<property name="nameofproperty2">
<column name="PROPERTY2" />
</property>
</class>
<class name="B" table="B">
<set name="As" inverse="true">
<key>
<column name="idA"/>
</key>
<one-to-many class="A" />
</set>
</class>
The hibernate-tools generates my POJOs from the hbm.xml and create 2 classes:
-AId which contains
- idB
- titi
+ getter/setter
-A which contains
- AId id
- B b
- nameofproperty1
- nameofproperty2
+ getter/setter
When I run the unit test, an error occurred:
"Could not find a getter for b in class AId"
Why should I add a getter for b?
Does it generate badly?
I don't understand.
Help!
Tim[code][/code]
|
|