[jboss-user] [JBoss Seam] - How does bijetion with new object references works?
hubaer
do-not-reply at jboss.com
Fri Feb 23 10:09:13 EST 2007
Hi all,
I have a question how bijection an object references works.
I have the following situation:
1. From a DataModel in overview page I outject an entry to details page.
2. From this page I outject the entry to a edit page.
3. Here I call a session bean via remote access and get a changed entry back.
If I assign this changed object to the variable in my action bean and outject it I get it on the next page correct. In my DataModel it is already the entry with the unchanged value.
So I seems to me that the object reference is not updated correctly.
Here a code fragment that only outject the entry but no update the data table reference:
| @Stateful
| @Name("userAction")
| @Scope(ScopeType.CONVERSATION)
| public class UserActionBean implements UserAction, Serializable {
|
| @In(required=true)
| @Out(required=true)
| private User user;
|
| public String refreshUser() {
| UserManager userManager = getUserManager(); // Get the remote session bean
| user = userManager.refreshUser(user);
| return "userDetails";
| }
| }
|
If I take the old entry and set the values from the changed entry I don't loose any datas.
| @Stateful
| @Name("userAction")
| @Scope(ScopeType.CONVERSATION)
| public class UserActionBean implements UserAction, Serializable {
|
| @In(required=true)
| @Out(required=true)
| private User user;
|
| public String refreshUser() {
| UserManager userManager = getUserManager(); // Get the remote session bean
| User tmpUser = userManager.refreshUser(user);
| user.setName(tmpUser.getName());
| user.setFirstName(tmpUser.getFirstName());
| // ... more set actions
| return "userDetails";
| }
| }
|
Maybe I missing something, but I thought that the reassignment of the variable should work.
Regards
Marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021133#4021133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021133
More information about the jboss-user
mailing list