-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate annotations without EJB3?
PostPosted: Thu Oct 06, 2005 3:33 am 
Beginner
Beginner

Joined: Thu Sep 16, 2004 8:14 pm
Posts: 27
I have looked all over for the answer to this and can't find a straightforward answer. Is it possible to use Hibernate Annotations with Hibernate 3.1 and Java 5 without anything from EJB3? This

http://www.hibernate.org/hib_docs/annot ... e/en/html/

has a section named "Mapping with EJB3 Annotations" and the Hibernate Annotations download contains a file ejb3-persistence.jar.

So, can someone straighten this out for me? How tied together are Hibernate Annotations and EJB3? And what do I need in order to just have a web application that runs in Tomcat and uses Hibernate and Java 5 annotations to persist data to a database?
Thanks,
-M@


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 3:45 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
The EJB3 spec defines persistence annotations. H implements this standard. EJB3 works outside of an EJB container, so do not get shy about the jar name ... it will run in tomcat, or a command line java app written in vi. There are H specific annotations that go beyond the spec as well.


Top
 Profile  
 
 Post subject: thanks
PostPosted: Thu Oct 06, 2005 12:56 pm 
Beginner
Beginner

Joined: Thu Sep 16, 2004 8:14 pm
Posts: 27
So I can just go ahead and use all of the annotations mentioned in the Hibernate Annotations documentation and that'll work for standalone Hibernate?
And, is the Hibernate Entity Manager only for use with an EJB container?
Thanks for clearing this up.
-M@


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 1:03 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
You can use entity manager outside of a container, or you can persist objects directly through H.

http://www.hibernate.org/hib_docs/entit ... cture.html


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 1:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, you can use Hibernate Annotations without Hibernate EntityManager. You can also use HA and HEM outside of JBoss EJB3.


Top
 Profile  
 
 Post subject: J2EE 5
PostPosted: Thu Oct 06, 2005 1:53 pm 
Beginner
Beginner

Joined: Thu Sep 16, 2004 8:14 pm
Posts: 27
Okay, so it looks to me like J2EE has gone through a significant change since version 1.3. That version required an EJB container to persist objects to the database. Now it looks like J2EE can be used more like a library, so the application can sit on top of EJB3 without running inside a container, or you can run a container that uses EJB3 to persist data on behalf of the application.
Is that correct?
Thanks again,
-M@


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 1:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Right, this has been our long-term vision for a while now.


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