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: generation from annotation mapped classes
PostPosted: Tue Aug 08, 2006 11:31 am 
Newbie

Joined: Tue Aug 08, 2006 11:11 am
Posts: 7
Hibernate version: 3.2cr2
Hibernate Tools version: 3.2 beta6
Hibernate Annotations version: 3.2cr1
Name and version of the database you are using: HSQL 1.8

Hi,
i am currently trying out some things with hibernate and have a little problem.

What i did successful:
- Create my object model as Java class
- Used annotations to map my class (Id, Basic, Transient)
- Create a hibernate.cfg.xml with the Hibernate Tools wizard
- Added a property "mapping" pointing to the annotated class

Now i tried to generate the hbm.xml and the database scheme from the annotations. I used the Hibernate Console wizard, enabled EJB3 annotations, added the hsql library and finished the wizard. I cant see my class listed in "Configuration" as i expected (and as it works with xml mapped classes). I tried to find the relevant part in the documentation, but didn't succeed.

Is the generation of hbm.xml and database scheme possible in this way? Or which way is the best, to generate these parts from java class code with the Eclipse Hibernate Tools?

Thanks for your help, David


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 8:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it is possible to do this way.

could you show me your hibernate.cfg.xml file ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 6:30 am 
Newbie

Joined: Tue Aug 08, 2006 11:11 am
Posts: 7
I'm very happy that i got it to work, but i have really no idea what i did. Now i saw that i can directly export the database scheme without generating any hbm.xml files. Is this true, that the annotations are a substitute for the hbm mappings? I never read that anywhere, but this would keep my project pretty clean. :)


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.