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.  [ 5 posts ] 
Author Message
 Post subject: Generate HBMs from POJOs in Eclipse?
PostPosted: Tue Aug 22, 2006 6:53 pm 
Newbie

Joined: Thu Jul 27, 2006 11:36 am
Posts: 10
Hibernate version: 3.1.3
Hibernate Tools version: 3.2 beta6
Name and version of the database you are using: HSQL 1.8.0.5

I am trying to create HBM files from my POJOs using the Hibernate Tools Plugin but every time I try to run the generator it spins for a second and does nothing.

I have the following hibernate.cfg.xml file which I created using the wizard:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory name="hsqlSessionFactory">
        <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
        <property name="hibernate.connection.url">jdbc:hsqldb:.</property>
        <property name="hibernate.connection.username">sa</property>
        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
    </session-factory>
</hibernate-configuration>


I created the hibernate console config at the same time:
(an image is attached showing the console)
Image

Once I created these I did the following to try to generate the HBM files:
1) Run -> Hibernate Code Generation -> Hibernate Code Generation
2) Create new generator
3) Select the evaluation configuration (that I just made)
4) Set the output directory
5) Select the exporters tab and check the Hibernate XML mappings
6) Click Apply
7) Click Run
8) Spin for a sec and nothing happens

Is it possible to generate HBM files this way or do I need to do something different?

Thanks
-AZ


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 22, 2006 7:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
H2 had a tool but it was incomplete and has since been removed (for good reasons). HBM from POJOs is usually done by XDoclet using the appropriate markup. Alternative, you could add Java 5 annotations but in that case why bother with the HBMs. In both cases, the extra markup is required as a POJO does not have enough information to create a working/approrpiate/complete HBM.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 22, 2006 8:10 pm 
Newbie

Joined: Thu Jul 27, 2006 11:36 am
Posts: 10
I am using java 1.4.2 so the annotations are not really an option. What is the XDoclet method? Can someone post a link or something?

Thanks for the info
-AZ


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 22, 2006 8:11 pm 
Newbie

Joined: Thu Jul 27, 2006 11:36 am
Posts: 10
oops, duplicate post, sorry


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 7:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
XDoclet project http://xdoclet.sourceforge.net/

Tutorial http://www.downside.ch/blog/?page_id=37

Wiki Information http://www.hibernate.org/72.html

There are lots of resources.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.