Hibernate version 3.1.3 and backend postgres8.0
I have a many-to-many relation between company and location linked by
company_location table
I have defined a set on my company.hbm.xml file
<set name="offices" batch-size = "20" outer-join="auto" cascade="save-update">
<key column="company_id"/>
<one-to-many class="CompanyLocations"/>
</set>
On my CompanyLocation.hbm.xml file (link table)
I have a many-to-one relation to office defined
<many-to-one name= "salesOffice" column="office_id" cascade="none" not-null="true" />
// java code
Object[] tmp = jlstOffices.getSelectedValues();
for(int i = 0 ; i < tmp.length ; ++i)
{
company.getOffices().add((SalesOffice)tmp[i]);
}
When I try to save the company object, I get the error shown below. I
tried debugging the program I could see my persistent set of offices but when the primary key in my linking table is accessed i get this error.
Could some one help me on this.
//hibernate3.1.3 error
ERROR - IllegalArgumentException in class: CompanyLocations, getter method of property: cid
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of CompanyLocations.cid
|