]
Max Rydahl Andersen closed HBX-688.
-----------------------------------
Resolution: Duplicate
hbm2java is not generating the @Version annotation for the
<version ...> element
--------------------------------------------------------------------------------
Key: HBX-688
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-688
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.1.beta5
Reporter: Sean Dawson
Attachments: BasicPOJOClass.patch
See
http://forum.hibernate.org/viewtopic.php?p=2310547#2310547
Given a mapping file:
----
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jun 13, 2006 3:27:21 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
<class name="Sample" table="Sample">
<id name="id" type="java.lang.Long">
<column name="id" />
<generator class="native" />
</id>
<version name="version" column="version"/>
<property name="value" column="value"
type="string"/>
</class>
</hibernate-mapping>
----
the following ejb is generated (via hbm2java, ejb3="true",
jdk5="true":
----
// default package
// Generated Jun 16, 2006 3:23:35 PM by Hibernate Tools 3.1.0.beta5
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Sample generated by hbm2java
*/
@Entity
@Table(name="Sample"
)
public class Sample implements java.io.Serializable {
// Fields
private Long id;
private Integer version;
private String value;
// Constructors
/** default constructor */
public Sample() {
}
/** full constructor */
public Sample(String value) {
this.value = value;
}
// Property accessors
@Id @GeneratedValue
@Column(name="id", unique=false, nullable=false, insertable=true,
updatable=true)
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name="version", unique=false, nullable=false, insertable=true,
updatable=true)
public Integer getVersion() {
return this.version;
}
public void setVersion(Integer version) {
this.version = version;
}
@Column(name="value", unique=false, nullable=true, insertable=true,
updatable=true)
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
-----
There should be a @Version annotation on the version property!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: