Dear friends,
Problem: hbm2java in version 3 do not generate the class defined within the composite-id tag. But in version 2 it was generating the class co.omx.coon.resource.hibernate.beans.AccountGroupSubSupplierKey. is it a bug in version 3?
Here's my Map
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.omx.common.resource.hibernate.beans.AccountGroupSubSupplier" table="ACCOUNT_GROUP_SUB_SUPLR" >
<composite-id class="com.omx.common.resource.hibernate.beans.AccountGroupSubSupplierKey" name="accountGrpSuplrKey" unsaved-value="none">
<key-property name="accountGroup" column="ACCOUNT_GROUP" type="string" ></key-property>
<key-property column="SUB_SUPLR_ID" name="subSupplierId" type="big_decimal"/>
</composite-id>
<property name="subSupplierStatus" column="SUB_SUPLR_STATUS" type="string" />
<property name="lastModDate" column="LAST_MOD_DATE" type="date" />
<property name="lastModBy" column="LAST_MOD_BY" type="string" />
</class>
</hibernate-mapping>
and here's the java code generated by hbm2java
package com.omx.common.resource.hibernate.beans;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
public class AccountGroupSubSupplier implements Serializable {
/** nullable persistent field */
private String subSupplierStatus;
/** nullable persistent field */
private java.util.Date lastModDate;
/** nullable persistent field */
private String lastModBy;
/** full constructor */
public AccountGroupSubSupplier(String subSupplierStatus, java.util.Date lastModDate, String lastModBy) {
this.subSupplierStatus = subSupplierStatus;
this.lastModDate = lastModDate;
this.lastModBy = lastModBy;
}
/** default constructor */
public AccountGroupSubSupplier() {
}
public String getSubSupplierStatus() {
return this.subSupplierStatus;
}
public void setSubSupplierStatus(String subSupplierStatus) {
this.subSupplierStatus = subSupplierStatus;
}
public java.util.Date getLastModDate() {
return this.lastModDate;
}
public void setLastModDate(java.util.Date lastModDate) {
this.lastModDate = lastModDate;
}
Thanks for your time.
Chicagoram.
public String getLastModBy() {
return this.lastModBy;
}
public void setLastModBy(String lastModBy) {
this.lastModBy = lastModBy;
}
public String toString() {
return new ToStringBuilder(this)
.toString();
}
}
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: