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.  [ 2 posts ] 
Author Message
 Post subject: Generation of POJOs
PostPosted: Thu Aug 17, 2006 8:59 am 
Newbie

Joined: Thu Aug 17, 2006 5:32 am
Posts: 4
Hi,

in eclipse I have installed "HibernateTools-3.2.0.beta6a.zip" and try to generate a POJO with a call to "Run / Hibernate Code Generation...". In the "Exporters" page i have selected "Domain Code (.java)" only.

The Cow.hbm.xml file:

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">
<hibernate-mapping>
  <class name="Cow" table="COWS">
        <id name="id2" column="EVENT_ID">
            <generator class="native"/>
        </id>
        <property name="date" type="timestamp" column="EVENT_DATE"/>
        <property name="title"/>
  </class>
</hibernate-mapping>



MyCow.java file:

Code:
import java.util.Date;

public class Cow implements java.io.Serializable {
   private Long id2;

   private Date date;

   private String title;
}


The question is: Why have i to code the java-file? I thougt the tool would generate the java-file from Cow.hbm.xml.

Regards:
Franjo


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 9:14 am 
Newbie

Joined: Thu Aug 17, 2006 5:32 am
Posts: 4
Thanks to Max,

he has solved my problem.

I had to add the types to the properties.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.