Clicky

PersistenceException: ERROR executing DML bindLog[] error[Column 'XXX' specified twice]

July 30, 2015

Problem:

javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[Column ‘graphId’ specified twice]

(…)
@Required
public String city;
@Required
public String birthdate;
@Required
public String username;
@Required
public String password;
public Long role_id;
@ManyToOne
@JoinColumn(name = “role_id”)
public Role role;

**Solution: **

Tell Hibernatee not to process the join column a “second time”:

@ManyToOne
@JoinColumn(name = “role_id”, insertable = false, updatable = false)
public Role role;