Hibernate version:3.1
Hibernate Tools version:3.1.0 beta4a
Name and version of the database:Oracle 10g
Hi,
i generate .hbm.xml and POJOs with the Hibernate Tools via reveng.
The created POJO is not correct - in the full constructor is one field missing (the VERSION field).
Code:
/**
* AcVersGroup generated by hbm2java
*/
public class AcVersGroup implements java.io.Serializable {
// Fields
private String versGroupId;
private String version;
private String groupName;
// Constructors
/** default constructor */
public AcVersGroup() {
}
/** minimal constructor */
public AcVersGroup(String versGroupId) {
this.versGroupId = versGroupId;
}
/** full constructor */
public AcVersGroup(String versGroupId, String groupName) {
this.versGroupId = versGroupId;
this.groupName = groupName;
}
// Property accessors
public String getVersGroupId() {
return this.versGroupId;
}
public void setVersGroupId(String versGroupId) {
this.versGroupId = versGroupId;
}
public String getVersion() {
return this.version;
}
public void setVersion(String version) {
this.version = version;
}
public String getGroupName() {
return this.groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
}
The generated mapping file has not the element property for the field VERSION, it uses the element version. Is this a problem with the name version???
Code:
<?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 30.03.2006 11:15:34 by Hibernate Tools 3.1.0 beta3 -->
<hibernate-mapping>
<class name="mywork.pojo.AcVersGroup" table="AC_VERS_GROUP">
<id name="versGroupId" type="string">
<column name="VERS_GROUP_ID" length="10" />
<generator class="assigned" />
</id>
<version name="version" type="string">
<column name="VERSION" length="10" />
</version>
<property name="groupName" type="string">
<column name="GROUP_NAME" length="40" />
</property>
</class>
</hibernate-mapping>
Whats wrong, how can i fix it?
Thanks for help,
Michael