Hi!
Sometimes i meet some exceptions on use of @In and @Out, because i don't know exact meaning of those and attributes.
The common exception is:
*javax.ejb.EJBTransactionRolledbackException: could not set field value: XXX.service*
I declared like this:
@Stateless
@Entity("service")
public Class Service {
.....................
}
@Stateless
@Entity("XXX")
public Class XXX {
@In(create=true)
private Service service;
}
What is the problem in this code?
And maybe, you can explain me the difference between @In and @Out including their attributes such as "create", "required".
Thanks for you help!!!
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.
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
pawel.wrzesz.cz/blog