« Return to Thread: Validation of a screen of multiple domain objects

Re: Validation of a screen of multiple domain objects

by Martin Flower-2 :: Rate this Message:

Reply to Author | View in Thread

Thanks Peter - I think I had my mailing lists mixed up.  I do have a  
solution (of sorts), but I'm using this as an exercise in best  
practice - so I want to find the grooviest way.   I'll send a separate  
email to the user list and see what comments I get there.  Thanks.  
Martin

On 16 May 2008, at 12:19, Peter Ledbrook wrote:

> My create screen has one Book per row (isbn, title).  I want to  
> enforce
> unique isbn and unique name.  I can code this contraint in the Book  
> class,
> but when I Book.findByIsbn(val), I am only searching on the  
> persisted Books,
> not on those that have not yet been saved.  If I have the same Book  
> multiple
> times on the create screen, but none of which are saved, then no  
> error is
> detected by the contraints.  When I call save(), the first one is  
> saved and
> the others are discarded.

BTW, this kind of question should be directed to the user mailing
list. The added advantage is that more people read that list and can
help you :)

Cheers,

Peter

--
Software Engineer
G2One, Inc.
http://www.g2one.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Validation of a screen of multiple domain objects