Hi there,
i gut a little problem while setting up my hibernate mapping.
i got a "user" class which should have the attribute:
* String prename
* String lastname
* User replacementperson
so this class is a recurisve one.
everythink works fine - but not the recursive assosication.
all other properties work fine.
has anyone a solution what is wrong at this mapping?
thx in advance,
lars
my User.java
Code:
package eu.***.mappings;
public class User {
private int userid;
private String prename;
private String lastname;
private User replacementperson;
public String getPrename() {
return prename;
}
public void setLastname(String nachname) {
this.lastname = nachname;
}
public String getPrename() {
return prename;
}
public void setPrename(String vorname) {
this.prename = vorname;
}
public User getReplacementperson() {
return replacementperson;
}
public void setReplacementperson(String replace) {
this.replacementperson = replace;
}
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
}
my user.hbm.xml:Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="eu.***.mappings.User" table="user">
<id name="userid" column="userid" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="prename" column="prename" />
<property name="lastname" column="lastname" />
<one-to-one name="replacementperson" class="eu.***.mappings.User"/>
</class>
</hibernate-mapping>