-->
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.  [ 6 posts ] 
Author Message
 Post subject: (newbie) caveatemptor HiA 3.1 alpha1 annotations question
PostPosted: Thu Jul 21, 2005 12:19 am 
Newbie

Joined: Wed Jul 20, 2005 11:50 pm
Posts: 4
Location: Allentown, PA
Does the 3.1 version use annotations, hbm.xml files, or both?

I ran the ant unittest and unittest.ejb3 targets and both succeeded ie 0 failures. Then I deleted all .hbm.xml files hoping they'd be recreated by some annotation magic. They didn't, but all unit tests still pass. Does this mean the xml files are unused? ant exportddl seems to create schema ok even after the removal of the xml files and ant clean.

If one can use either annotations or xml files in caveatemptor, how does one switch between the two methods?

Is it possible to build the .hbm.xml files based on the annotations?

Thanks, Ian


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 12:36 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read Readme.txt...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 1:52 am 
Newbie

Joined: Wed Jul 20, 2005 11:50 pm
Posts: 4
Location: Allentown, PA
Oops! I did actually read it early on, but before I had any idea what any of this stuff was ... sorry, should have used grep as well as google. Thanks.

Remaining question: It's still not clear to me how (or if) you can generate .hbm.xml from the annotations. Have I missed another obvious item?

I suppose I could go with xdoclet(2) or even use middlegen to go annotations->schema->xml but I'd rather stick with "native" hibernate tools if possible. If it's not possible it's no biggie.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 3:11 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Why do you want to generate an hbm file from the annotations?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 4:54 am 
Newbie

Joined: Wed Jul 20, 2005 11:50 pm
Posts: 4
Location: Allentown, PA
- The xml files concisely document the DB structure, without being intermingled with the java code. OTOH the annotations provide a great way to keep classes and their DB representations in step. If I get xml from annotations, best of both worlds.

(BTW, I'm using java SE not EE and the DB is not usually a fixed server, it runs in an appliance.)

- would allow me the option to revert to an earlier hibernate version if necessary. With annotations in I can't go any earlier than 3.1.

- there may be cases where the schema info is needed in non-java code, prior to DB creation. Ideally in this case I'd provide the xml.

It seems such a tool doesn't exist ... my circumstances are probably atypical, perhaps very few people want it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 5:00 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You will be able to use XML descriptors in addition to annotations, once the syntax has been completely defined by the EJB3 expert group. If you want to convert this to Hibernate XML files for a backport you'll have to write your own converter.


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