Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: EJB3 Annotations behind EJB2 session beans
PostPosted: Fri Jan 28, 2005 11:07 am 
Newbie

Joined: Thu Jan 13, 2005 1:53 pm
Posts: 6
Is it possible to have Hibernate persistent classes written with EJB3 annotations used from within EJB2 session beans?

The persistent classes will require the EJB3 jar file, but the session beans will require the EJB2 jar file.

How do I get around the mismatch of EJB versions? Is it enough to put the EJB3 jar after the EJB2 one? I assume Hibernate only needs the definitions of the annotations from the EJB3 jar.

Also, along similar lines, if my session beans return any instances of the annotated classes to a client, then that client also needs the EJB3 jar in its classpath. Is there any way to get around that?


Top
 Profile  
 
 Post subject: Re: EJB3 Annotations behind EJB2 session beans
PostPosted: Mon Jan 31, 2005 6:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7179
Location: Atlanta, USA
colinws wrote:
Is it possible to have Hibernate persistent classes written with EJB3 annotations used from within EJB2 session beans?

Sure, just do it.

colinws wrote:
The persistent classes will require the EJB3 jar file, but the session beans will require the EJB2 jar file.
How do I get around the mismatch of EJB versions? Is it enough to put the EJB3 jar after the EJB2 one? I assume Hibernate only needs the definitions of the annotations from the EJB3 jar.

The 2 will not clash, since EJB3 will be abckward compatible with EJB2

colinws wrote:
Also, along similar lines, if my session beans return any instances of the annotated classes to a client, then that client also needs the EJB3 jar in its classpath. Is there any way to get around that?

You'll be able to use the description descriptor instead, but I don't really consider the ejb3-ann.jar too much a requirement in the client side, it will be small.

_________________
Emmanuel
Check Hibernate Search in Action out


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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.