my class :
Code:
ublic class Record {
private Long id;
private int quantity;
private Toto toto;
public Record() {}
public Record(
Long id,
int quantity,
) {
this.id = id;
this.quantity = quantity;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public class Toto {
protected int id;
protected Record record;
protected String champ1;
/**
* @return Returns the champ1.
*/
public String getChamp1() {
return champ1;
}
/**
* @param champ1 The champ1 to set.
*/
public void setChamp1(String champ1) {
this.champ1 = champ1;
}
/**
* @return Returns the id.
*/
public int getId() {
return id;
}
/**
* @param id The id to set.
*/
public void setId(int id) {
this.id = id;
}
/**
*
*/
public Toto() {
super();
}
/**
* @return Returns the record.
*/
public Record getRecord() {
return record;
}
/**
* @param record The record to set.
*/
public void setRecord(Record record) {
this.record = record;
}
}
/**
* @return Returns the toto.
*/
public Toto getToto() {
return toto;
}
/**
* @param toto The toto to set.
*/
public void setToto(Toto toto) {
this.toto = toto;
}
}
mapping file :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<!-- Component org.hibernate.perf.Record$Toto is a nested class! -->
<hibernate-mapping>
<!-- org.hibernate.perf.Record root -->
<class name="org.hibernate.perf.Record" table="Record">
<id name="id" type="long" column="id">
<generator class="native"/>
</id>
<property name="quantity" column="quantity" type="int"/>
<property name="toto" column="toto" type="org.hibernate.perf.Record$Toto"/>
</class>
</hibernate-mapping>
exception :
[code]
23 ao