-
1. Re: Injection and Outjection
zergspirit Jul 16, 2008 9:43 AM (in response to knhsinbad)As far as I know you can't do injection an Entity bean, it simply doesn't work.
About the explanation, I doubt I can do it better than in the docs, I'd advice you to read carefully those and maybe ask your questions afterward. -
2. Re: Injection and Outjection
wrzep Jul 16, 2008 10:22 AM (in response to knhsinbad)You mix 2 things, so don't be surprised it does not work :) Stateless session beans (@Stateless) and JPA entities (@Entity) should be different objects. Maybe you ought to read a bit about ejb3 or have a look at the examples :)
Cheers,
-Pawel -
3. Re: Injection and Outjection
vcherkassky Nov 27, 2009 6:41 PM (in response to knhsinbad)For anyone who wants to know what exactly is wrong with the code.
@Stateless is EJB annotation which marks EJB bean as statefull.
@Entity is a JPA annotation which marks POJO as DB Entity. Seam manages all @Entity marked objects as entities, so you don't need any further configuration like adding some AnnotationConfigurator (which was needed in spring).@In and @Out annotations can only be applied to Seam managed beans (POJO or EJB). It is also wrong to use @Entity as Seam bean (by adding @Name annotation) as in (for example) hibernate entity has its own lifecycle.
-
4. Re: Injection and Outjection
asookazian Dec 1, 2009 11:27 PM (in response to knhsinbad)Sorry, the last post has a couple of mistakes in it.
@Stateless denotes a SLSB, not SFSB.
You can use @Entity with @Name: http://java.dzone.com/articles/magic-jboss-seam. If you want to refer directly to a JPA entity from a JSF EL method, then you must use @Name with @Entity (see SiA book for examples).
AFAIK bijection interceptors are not active/available with JPA entity classes, but are active with session beans and JavaBeans.