I've set the "unsaved-value" to -1 and initialized the int id with -1 like this:
package test.data.hibernate;
Code:
/**
* @hibernate.class
* table = "client"
*/
public class Client{
[b]private int id = -1[/b];
private String name;
/**
* @hibernate.property
*/
public String getName() {
return name;
}
public void setName(String model) {
this.model = model;
}
/**
* @hibernate.id
* generator-class = "increment"
* [b]unsaved-value = "-1"[/b]
*/
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}