hi guys,
I run into an odd problem.
We are using hbm2java target to autogenerate Hibernate mappings and beans from the database.
I seem to have issue with the PoJo generated.
I expect the annotation for a getter method to look like below:
/**
* @hibernate.id
* generator-class="assigned"
* type="java.lang.String"
* column="ORG_UNIT_SYS_ID"
*
*/
public String getOrgUnitSysId() {
return this.orgUnitSysId;
}
However, I am getting this instead:
/**
* @hibernate.property
* column="ORG_UNIT_SYS_ID"
* length="80"
*
*/
public String getOrgUnitSysId() {
return this.orgUnitSysId;
}
The database script used to create the table:
CREATE TABLE ORG_UNIT
(
ORG_UNIT_SYS_ID VARCHAR2(80 BYTE) NOT NULL,
ORG_UNIT_CODE VARCHAR2(8 BYTE),
REF_ORG_UNIT_CODE VARCHAR2(8 BYTE),
ORG_UNIT_DESC VARCHAR2(200 BYTE),
LEAVE_TYPE_CODES VARCHAR2(4000 BYTE)
)
I am using a very simple code generation configuration in hbm2java.config
<codegen>
<meta attribute="scope-field">protected</meta>
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
</codegen>
Could someone help me out? Am I missing something obvious here?
Thanks,
pali
|