Joined: Mon Nov 13, 2006 9:04 am Posts: 3
|
Hi guys
I get the following error, when I try to save the entity B:
session.saveOrUpdate(B);
org.hibernate.PropertyAccessException: could not get a field value by reflection getter of A.id
I´m using Hibernate 3.
<class name="A" schema="S" table="A">
<id name="id" column="A_ID">
<generator class="increment">
<param name="schema">S</param>
</generator>
</id>
<property name="number" column="NUMBER" not-null="true" length="3"/>
</class>
<class name="B"
schema="S" table="B">
<id name="id" column="B_ID">
<generator class="increment">
<param name="schema">S</param>
</generator>
</id>
<property name="description" column="DESCRIPTION" />
<list name="mybs" schema="STRECKE" table="B_A">
<key column="B_id"/>
<list-index column="B_A_id"/>
<many-to-many column="A_id" class="A"/>
</list>
class A {
private int id;
private setId(int id) {this.id=id;}
private int getId() {return this.id;}
private String number;
private setNumber(String id) {this.number=number;}
private String getNumber() {return this.number;}
}
class B {
private int id;
private setId(int id) {this.id=id;}
private int getId() {return this.id;}
private String description;
private setDescription(String description) {this.description=description;}
private String getDescription() {return this.description;}
List mybs;
public String getMybs() {return this.mybs;}
public void setMybs(String mybs) {this.mybs = mybs;}
}
What´s wrong here???
Any hints will be kindly appreciated.
Thx
|
|