-->
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: Annotation without EJB
PostPosted: Mon Feb 07, 2005 5:43 pm 
Newbie

Joined: Mon Feb 07, 2005 6:30 am
Posts: 8
Location: Paris, London
Hi,

I'm trying to use hibernate 3 with annotation but without EJB.
Is it possible ? I can't figure out if it is or not possible.

To be really clear : I would like to use hibernate3 framework with the help of annotation instead of xml configuration files. I don't want to use any application server nor any EJB classes like sessionbean or entitybean.

I understand that it could be possible but on the other hands, annotation definition are in ejb3.jar.
I'm a little bit disapointed.

In fact, whatever the answer is, I would like to understand why ...

Thank you for your help !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 08, 2005 8:58 am 
Newbie

Joined: Fri Jan 28, 2005 4:08 am
Posts: 1
ejb3.jar defines the annotations. So you use the same annotations as you would use in EJB 3.0 to specify an entity Bean.

"Hibernate Annotations" reads this annotations and prepares this meta data for the "normal" hibernate api.

"Hibernate Annotations" doesn't need an application server. Only the ejb3.jar as annotation library.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 09, 2005 8:48 am 
Newbie

Joined: Mon Feb 07, 2005 6:30 am
Posts: 8
Location: Paris, London
OK, but when does it take annotation into account without EJB then ?
Is it when I add classes into the config :
Code:
     sessionFactory = new AnnotationConfiguration()
                    .addPackage("test");
                    .addAnnotatedClass(Flight.class)
                    .addAnnotatedClass(Sky.class)
                     ...


I would like to understand when that step is run.

Does it produce an xml mapping file ? If yes, where can I find the file ?
Or maybe it is a xml memory stream ?

Any light apreciated !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 09, 2005 11:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The AnnotationConfiguration uses its own binder mechanism to generate the metamodel Hibernate uses internal to configure itself (the hbm binder does the same thing given xml files). No, there is no intermediary "xml step".

Also, as this *is* open source, its easy enough to see for yourself exactly what is going on and when. http://cvs.sourceforge.net/viewcvs.py/hibernate/HibernateExt/metadata/src/java/org/hibernate/cfg/AnnotationConfiguration.java?rev=1.15&view=auto


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 09, 2005 11:47 am 
Newbie

Joined: Mon Feb 07, 2005 6:30 am
Posts: 8
Location: Paris, London
Thanks a lot.

You right, lets explore the source !


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.