-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Generator not generating Properties - just IDs
PostPosted: Sat Apr 17, 2004 1:25 am 
Beginner
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;
}


}


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 8:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you checked the log output from hb2mjava ?

could it be it tells you that it cannot generate a property for you because you have not specified a type for a property ?

Because that you need to do!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Oops...
PostPosted: Sat Apr 17, 2004 9:14 am 
Beginner
Beginner

Joined: Sat Apr 17, 2004 1:11 am
Posts: 36
Thx Max - It was a bit late and I'd run it quietly. Sorry - that was a stupid one...

benster


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.