[jboss-user] [JBoss Seam] - Re: How To Cancel Update in Home Object

2007-04-20 Thread baz
One question:
What do you trying to do?
Perhaps this is your desire?
http://www.jboss.com/index.html?module=bbop=viewtopict=106710
If not please ask again.
And if someone knows the solution to my lasting little problem, eben better.
Hope i could help a little.
Ciao,
Carsten

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039177#4039177

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039177
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: How To Cancel Update in Home Object

2007-04-20 Thread gzoller
Carsten,

I think we're looking at the same problem from different angles.  One desired 
behavior I'm looking for is the ability to cancel a data entry page w/o the 
changes popping up in the persistent state.  I have one page in my app that 
does this just fine and one that (like yours) somehow persists and keeps the 
values I wanted to throw away upon cancel.  I'll have to do a line-by-line 
comparison to figure out what the differences are.

The heart of my question is more about the ability to access a field's previous 
value prior to persisting it, for example in a Home object's update() method.  
Say for example in update() you'd like to take the difference between a field's 
old and newly set value and do something with the difference.  How would you 
get the old value?

At the time update() is called the Entity's field has already been set in 
memory via setFoo(), so no help there.  Aha, I thought---I can just hit the db 
with a query to temporarily pull back the previous value (the find() I show in 
my example code).  But strangely the new value comes back from the query.

Here's what gets me:  If I'm hitting the db from within the update() method the 
new value may exist in memory but hasn't (shouldn't) have been persisted until 
I call super.update(), right?  So why am I getting the new value back?  Hmm.

I'd love to know what others have done if they needed to compare old/new values 
of fields during setting or persisting.  The only other thing I thought to try 
next is to save old values internally in the Entity (transiently of course) and 
hope that old value is still the last value set when update() is called.

Greg

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039365#4039365

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039365
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: How To Cancel Update in Home Object

2007-04-20 Thread petemuir
Have you looked at this?  Its not quite what you are trying to do, but it does 
access both the old and new variables...
http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamAuditHome

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039367#4039367

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039367
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: How To Cancel Update in Home Object

2007-04-20 Thread gzoller
Many thanks for the tip.  No, this isn't quite what I'm after, but it looks 
quite handy for something else, so much obliged.

I finally got the old/new thing working by simply holding a transient property 
that is saved off in the setter of the field I want to access old/new values 
for.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4039461#4039461

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4039461
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user