Hi,
I am not sure whether I can inject a session bean (e.g. currentUser) into a
stateless session bean, and each user will have his owner username in the
stateless session bean when he/she call it. For example:@Stateless
| @Name("friend")
| public class FriendAction implements Friend {
|
| @In
| private Person user;
|
| @Out
| private List <Person> friends;
|
| @PersistenceContext
| private EntityManager em;
|
| public void retrievFriends () {
| friends = em.createQuery("select pf.friend from PersonFriend pf where
pf.person.id=:userId")
| .setParameter("userId", user.id());
| .getResultList();
| }
|
| }Thank you.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121014#4121014
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121014
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user