]
Razan Abbass commented on HBX-265:
----------------------------------
[cheap airline
dynamicUpdate property in Entity annotation not work
----------------------------------------------------
Key: HBX-265
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-265
Project: Hibernate Tools
Issue Type: Bug
Components: annotations (obsolete)
Affects Versions: 3.0beta1
Environment: Hibernate 3 hibernate annotations 3.0 beta1
Reporter: Rogerio Saulo
Fix For: 3.0beta2
The property dynamicUpdate when set on the Entity annotation does not remove NULL columns
from the UPDATE statement.
For the dynamicInsert it is working.
Below is my POJO, code to execute and generated UPDATE Statement.
POJO :
------------------------------------------------------------------
@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")
public Timestamp getCreation_timestamp() {
return creation_timestamp;
}
@Column (name = "email")
public String getEmail() {
return email;
}
@Id (generate=GeneratorType.TABLE, generator="USERS_GEN")
public Integer getId_user() {
return id_user;
}
@Column (name = "last_change_timestamp")
public Timestamp getLast_change_timestamp() {
return last_change_timestamp;
}
@Column (name = "login")
public String getLogin() {
return login;
}
@Column (name = "passwd")
public String getPasswd() {
return passwd;
}
.... (Setters come here)
}
--------------------------------------------------------------------
Code executing :
--------------------------------------------------------------------
UserVO obj = new UserVO();
obj.setId_user(new Integer(1));
obj.setEmail("alterado(a)teste.com");
session.update(obj);
--------------------------------------------------------------------
Generated update statement :
Hibernate: update USERS set creation_timestamp=?, last_change_timestamp=?, email=?,
login=?, passwd=? where id_user=?
--------------------------------------------------------------------
Thanks in advance.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: