Beginner |
|
Joined: Sat Apr 17, 2004 1:11 am Posts: 36
|
I'm a bit of a newbie, I guess - just having started playing with this today. I've got everything up and running and working but am trying to generate my POJOs. When I do that whether I use the VelocityRenderer or BasicRenderer I only get the IDs for the hbm.xml files generated. I can't see what's going on and have searched the forums here and abroad. Can anyone help an ignorant soul (who has done quite a bit of searching on this issue and can't find any solution)?
I'm using the latest Hibernate and Hibernate-tools - downloaded today.
Here's a couple of example hbm.xml files and the output of their generation using VelocityRenderer:
=====
Company.hbm.xml
=====
Sat Apr 17 01:29:05 bmorriso@jolt ~/source/mb/hibernate $ cat Company.hbm.xml Emp.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="net.fivedown.mb.bom.Company" table="COMPANY">
<id name="id" type="long" unsaved-value="null" >
<column name="COMPANY_ID" sql-type="numeric" not-null="true"/>
<generator class="sequence">
<param name="sequence">company_id_seq</param>
</generator>
</id>
<property name="name">
<column name="NAME" sql-type="varchar(50)" not-null="true"/>
</property>
</class>
</hibernate-mapping>
=====
Emp.hbm.xml
=====
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="net.fivedown.mb.bom.Emp" table="EMP">
<id name="id" type="string" unsaved-value="null" >
<column name="EMP_ID" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="name">
<column name="NAME" sql-type="varchar(50)" not-null="true"/>
</property>
</class>
</hibernate-mapping>
=====
OUTPUT:
=====
/**
* POJO for Company
* @author hbm2java
*/
public class Company implements java.io.Serializable {
// Fields
private java.lang.Long id;
// Constructors
/** full constructor */
public Company() {
}
public java.lang.Long getId() {
return this.id;
}
public void setId(java.lang.Long id) {
this.id = id;
}
}
/**
* POJO for Emp
* @author hbm2java
*/
public class Emp implements java.io.Serializable {
// Fields
private java.lang.String id;
// Constructors
/** full constructor */
public Emp() {
}
public java.lang.String getId() {
return this.id;
}
public void setId(java.lang.String id) {
this.id = id;
}
}
|
|