java - Hibernate OneToOneToOne Mapping -


i keep getting error:

error saving identity in identitydaoimpl. reason: org.hibernate.propertyvalueexception: not-null property references null or transient value: com.domain.identity.password 

i've mapped 3 tables on onetoonetoone mapping basis.

user -> account -> identity

how have now, identity extends account , account extends user.

maybe i'm not mapping correctly. find bit tricky because there's 3 1 one relationships instead of 2...

what's correct way of doing this?

edit 1:

i've changed merge() methods save() didn't fix problem.

edit 2:

here clean version of entity:

@entity() @table(name = "`user`") @inheritance(strategy = inheritancetype.joined) @discriminatorcolumn(discriminatortype = discriminatortype.string, name = "type") @discriminatorvalue("") public class user extends actionsupport implements userdetails, serializable {  private static final long serialversionuid = -7480567862246640031l; private integer id; private string type; private string password;  @id @generatedvalue(strategy = generationtype.auto) @column(name = "id") public integer getid() {     return id; }  public void setid(integer id) {     this.id = id; }  @column(name = "type", nullable = false, unique = false, length = 255) public string gettype() {     return type; }  public void settype(string type) {     this.type = type; }  @override @column(name = "password", nullable = false, length = 255) public string getpassword() {     return password; }  public void setpassword(string password) {     this.password = password; } 

}

can see how define password field on entity? guess you're trying save sth. password of null , violates either @notnull or sth. required=true


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -