-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Annotations without EJB?
PostPosted: Tue Nov 20, 2007 2:52 pm 
Beginner
Beginner

Joined: Wed Jun 07, 2006 12:28 pm
Posts: 22
This question may already exist but of course search is broken.

I'm trying to avoid mapping files and I have a requirement that we not use the EJB container.

Do annotations exist for Hibernate which don't require EJB? I read the Hibernate annotations doc and it appears to rely heavily on EJB entities (e.g. @Entity). Does one need the EJB container to use @Entity? I have also used the EJB3/JPA annotations pretty extensively in Seam. The following line seems to indicate that you can do this but the doc doesn't speak to it:

Quote:
You may use a combination of all three together, annotations without EJB3 programming interfaces and lifecycle, or even pure native Hibernate, depending on the business and technical needs of your project.


http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#d0e33

Thanks for the advice


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 8:47 am 
Newbie

Joined: Mon Nov 19, 2007 1:57 pm
Posts: 14
Hello monkeyden,
I use EJB annotations without container. Hibernate work properly.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 9:48 am 
Beginner
Beginner

Joined: Wed Jun 07, 2006 12:28 pm
Posts: 22
Hi Pasha,
Thanks a lot for the response. Any differences in the usage or is it the same?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 10:05 am 
Newbie

Joined: Mon Nov 19, 2007 1:57 pm
Posts: 14
About usage read "Hibernate Annotations Reference Guide" from annotations package;
some additional libs must be present in classpath and session factory created in another way:
sessionFactory = new AnnotationConfiguration().buildSessionFactory();


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