Hi,
version: hibernatetools-3.1.0.beta5
I am using the generated toString method, but it seems that generated code falls in a loop for bidirectional associations:
as a sample imagine account and activity entities
Code:
<class name="Account">
<id name="id" column="Account_Id" type="long">
<generator class="increment"/>
</id>
<set name="activity" inverse="true" >
<key column="Account_Id"/>
<one-to-many class="Activity"/>
</set>
</class>
**********************
<class name="Activity">
<id name="id" column="Activity_Id" type="long">
<generator class="increment"/>
</id>
<many-to-one name="account" unique="false"
not-null="false" class="Account"
column="Account_Id" foreign-key="FK_Activity_Account"/>
</class>
Then the generated toStrings are:
Code:
Account
toString()
{
(1)buffer.append("activity").append("='").append(getActivity()).append("' ");
}
********************
Acitivity{
tostring()
{
(2)buffer.append("account").append("='").append(getAccount()).append("' ");
}
Line (1) and (2) are the lines which keep calling each other when I try to write Account Entity.
Same goes with hascode() method.
Please help
Regards,
Alireza Fattahi