[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread miloslav.vlach
But how to do with this situation:

there is no @Begin annotated method. Page is displayed and when clicking the 
button actionlistener is called.


public String save() {
}

How to do in this situation ?
Thanks Mila

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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread [EMAIL PROTECTED]
Easy: Don't modify your data. If you do not have a conversation, then the 
entity instances have to be loaded by you from the database and it is you who 
are modifying these instances. Do your validation before you modify the 
instances.

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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread [EMAIL PROTECTED]
If you want more specific help, as always, post your code.


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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread miloslav.vlach
There is code


  | @Name(requestAction)
  | @Stateful
  | @Restrict(#{identity.loggedIn})
  | public class RequestAction implements RequestActionLocal, Serializable {
  | 
  | 
  | 


  | 
  | @ValidatedMethod(formName = editForm, validators = { 
@CustomValidator(validatorClass = RequestSaveValidator.class, mapping = { 
category, requestType,
  | request }) })
  | @End(beforeRedirect = true)
  | public String update() {
  | log.info(adding the request #0, request);
  | em.refresh(category);
  | em.refresh(requestType);
  | 
  | if (!requestType.getRequests().contains(request)) {
  | requestType.getRequests().add(request);
  | }
  | request.setCategory(category);
  | request.setAuthor(loggedUser);
  | request.setCreated(new Date());
  | request.setRequestType(requestType);
  | 
  | em.persist(request);
  | em.flush();
  | return DefaultActions.EDITED;
  | }
  | 
  | @Begin(join = true, flushMode=FlushModeType.MANUAL)
  | public String loadDetail() {
  | edit();
  | return DefaultActions.LOADED;
  | }
  | 

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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread miloslav.vlach
I remove the resfresh, but problem is,when validation failed some attributes 
are set and persisted to the entity Requst. 


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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread [EMAIL PROTECTED]
And? All I can see is that you probably do not know how refresh() is used 
properly (in 5 years of Hibernate I never needed it).


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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-15 Thread [EMAIL PROTECTED]
Then that's the problem of how @ValidatedMethod works, which I guess is 
something you wrote.


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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-14 Thread [EMAIL PROTECTED]
Throw an exception which causes a roll back, or, IMO a better option is to use 
the manual flush mode pattern./

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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-14 Thread miloslav.vlach
Where can I read some about manual flushing ?

Only set
@Begin(flushMode)

and 

em.flush() 

?
 Or something special ?

Thanks Mila

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

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


[jboss-user] [JBoss Seam] - Re: validation and persisting

2007-08-14 Thread [EMAIL PROTECTED]
AS you write.

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

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