Ordered many-to-many are not currently supported, and I'm not sure how
efficient it would be to do it, from a performance point of view. A reorder
would result in a lot of updates if keeping the sort indexes in the
many-to-many table.

You could maybe use this variant, in which you define the many-to-many
relation object yourself:
        Entity EntityA { 
                    String name key 
                    - List<@EntityABRelation> relatedTypeBs opposite entityA
                }
                
                ValueObject EntityABRelation {
                        - @EntityA entityA opposite relatedTypeBs
                        - @EntityB entityB opposite relatedTypeAs
                }  
                
                Entity EntityB {
                        String name key
                        - List<@EntityABRelation> relatedTypeAs opposite entityB
                }


But, I would suggest another design. Maybe storing the ordered ids as a
comma separated string in EntityA and use a Set for the many-to-many
association and do the sorting in java.

/Patrik 



greatfooty wrote:
> 
> Guys
> 
> Not sure if this is possible using sculptor but I'm trying to figure
> neatest way to do re-ordering of a List of EntityB where it participates
> in a many-to-many relationship with EntityA. So say for example I've
> defined as follows:
> 
> Entity EntityA {
>     String name key
>     - List<@EntityB> relatedTypeBs <-> relatedTypeAs
> }
>  
> Can I retrieve an instance of EntityA, then within my UI offer a neat
> list-shuttling page to enable re-order the List of EntityB and then simply
> have it persisted by using EntityAService.update(entityA) ?? 
> 
> Or do I need to manage this manually by say explicitly modelling an
> intersecting entity and/or manipulating the intersecting entity
> auto-created by sculptor ?? Any suggestions on neatest approach for this?   
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Re-ordering-a-related-List-of-entities--tp26296763s17564p26306960.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to