I would do something like - obviously you need to deal with the case your id is null
better...
@Name("currentUserManager")
| @Scope(CONVERSATION)
| public class CurrentUserManager {
|
| @In(required="false", value="currentUserId")
@Out(scope=SESSION, value="currentUserId")
| private Object id;
|
| @In
| EntityManager entityManager;
|
| @Factory
| public User getCurrentUser() {
| if (id != null) {
| return entitymanager.find(User.class, id);
| }
| return new User("noone");
| }
|
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081065#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...