-->
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: Generating POJO within eclipse
PostPosted: Thu Aug 17, 2006 7:47 am 
Newbie

Joined: Thu Aug 17, 2006 5:32 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hi,

i try to generate a POJO from the file cow.hbm.xml (shown below). I have installed "HibernateTools-3.2.0.beta6a.zip" and call in eclipse "Run / Hibernate Code Generation...". In the "Exporters" page i have selected "Domain Code (.java)" only. I get the following error-message:

Code:
-----------------------------------------------------------
org.hibernate.MappingException: Could not read mapping document from file: D:\Weres\Java\HibernateTest2\Cow.hbm.xml
  org.hibernate.MappingException: class Cow not found while looking for property: id2
    org.hibernate.MappingException: class Cow not found while looking for property: id2
    java.lang.ClassNotFoundException: Cow
-----------------------------------------------------------


In the Hibernate Console Configuration i have added the cow.hbm.xml. So the file should be known to the tool.



Hibernate version: 3.2

Mapping documents:
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>



Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 8:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you want pojo code generated you would need to tell hibernate what the type of your properties are.

_________________
Max
Don't forget to rate


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

Joined: Thu Aug 17, 2006 5:32 am
Posts: 4
Many thanks, your answer solved my problems.


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.