Patrik Nordwall wrote:
> 
> I think the solution for this problem is to use cascade="none" for the
> item reference in SequencedItem.
> 
>         ValueObject SequencedItem { 
>             - @ItemSet itemSet <-> seqItems 
>             Integer sequence range="min=1" 
>             - @Item item cascade="none"    
>         } 
> 
> /Patrik
> 

Thanks Patrick this works well - and my apologies for not replying sooner,
i've been held back from sculptor for a period but now able to get back into
it. With luck i'll be given enough time now to complete pilot site.

Note a related problem that I'm now pondering though is whats the best
strategy for dealing with user attempts to remove a referenced Item while
its still participating in a one-way relationship (like the non-cascaded one
in this example)?  I've read the sculptor guide re adding validation and had
figured it'd be wise to include a custom validation method annotated with
@preremove to check that the Item wasn't in use .. but then realised i'd
have no relationship to check and seems i can't do the validation from that
entity itself ie. given that the Item is oblivious to what other objects
point at it. 

Is there a neat way to handle this in sculptor to prevent users getting an
SQLException: Integrity constraint violation? I'm just wanting to return a
val msg saying something like "Item cannot be removed whilst referenced
elsewhere" 
-- 
View this message in context: 
http://old.nabble.com/-Sculptor--detached-entity-passed-to-persist--tp27648394s17564p28251900.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to