Hi,
I don´t know if I´m doing something wrong, but form me the hibernate does not exclude columns with null value from the insert or update SQL statement.
I think that i possible is missing something.
Below is the relevant part of my POJO.
Thanks
@Entity
@org.hibernate.annotations.Entity ( dynamicInsert = true, dynamicUpdate = true )
@Table (name = "USERS")
@javax.persistence.GeneratedIdTable(
name="GEN_TABLE",
table = @Table(name="VENUS_IDS"),
pkColumnName = "KEY_ID",
valueColumnName = "LAST_VALUE"
)
@javax.persistence.TableGenerator(
name="USERS_GEN",
tableName="GEN_TABLE",
pkColumnValue="ID_USER",
allocationSize=1
)
public class UserVO implements Serializable {
private Integer id_user;
private String login;
private String email;
private String passwd;
private Timestamp creation_timestamp;
private Timestamp last_change_timestamp;
@Column (name = "creation_timestamp", nullable = true, unique = false)
public Timestamp getCreation_timestamp() {
return creation_timestamp;
}
@Column (name = "email", nullable = false, length=100, unique = false)
public String getEmail() {
return email;
}
@Id (generate=GeneratorType.TABLE, generator="USERS_GEN")
public Integer getId_user() {
return id_user;
}
@Column (name = "last_change_timestamp", nullable = true, unique = false)
public Timestamp getLast_change_timestamp() {
return last_change_timestamp;
}
@Column (name = "login", nullable = false, length=50, unique = false)
public String getLogin() {
return login;
}
@Column (name = "passwd", nullable = true, length=128, unique = false)
public String getPasswd() {
return passwd;
}
....
}
|