Re: [Simple-support] CycleStrategy and complex relationships
Brought to you by:
niallg
|
From: MireilleMoreira <mir...@ya...> - 2008-07-30 12:28:50
|
Thanks for the answer. I kinda figured out what's wrong. The problem is that I get my beans from the database, and the persistence framework initializes two instances of the same object, in that case, two instances of class A (the instance of A within class C is another one), and Simple XML doesn't understand that they are the same objects (although they have the same id and the same attributes, and the equals method is right implemented). It causes an infinite loop, then finally to StackOverflowError. :( Niall Gallagher-2 wrote: > > Hi, > > This does not look like a complicated relationship. How have you annotated > your classes? > > Niall > > > --- On Tue, 7/29/08, MireilleMoreira <mir...@ya...> wrote: > >> From: MireilleMoreira <mir...@ya...> >> Subject: [Simple-support] CycleStrategy and complex relationships >> To: sim...@li... >> Date: Tuesday, July 29, 2008, 2:56 PM >> Hello, >> >> I followed the Simple XML Tutorial >> (http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php) >> for serialization, but I have cyclic relationship in my >> beans. The example >> in the tutorial only tells how to serialize it with >> CycleStrategy for a >> simple cyclic relationship (Child has a Parent, and a >> Parent has a >> collection of Child), and also tells that CycleStrategy can >> be used for >> complex relationships. >> I'd like to know how to do that (complex >> relationships). I tried the simple >> way and I got nothing. Does anyone have an example? >> >> My cyclic relationship is like that: >> >> public class A { >> private List< B> b; >> ... >> } >> >> public class B { >> private C c; >> ... >> } >> >> public class C { >> private A a; >> ... >> } >> >> >> Thanks in advance! >> -- >> View this message in context: >> http://www.nabble.com/CycleStrategy-and-complex-relationships-tp18721852p18721852.html >> Sent from the Simple XML Serialization mailing list archive >> at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move >> Developer's challenge >> Build the coolest Linux based applications with Moblin SDK >> & win great prizes >> Grand prize is a trip for two to an Open Source event >> anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Simple-support mailing list >> Sim...@li... >> https://lists.sourceforge.net/lists/listinfo/simple-support > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > -- View this message in context: http://www.nabble.com/CycleStrategy-and-complex-relationships-tp18721852p18732138.html Sent from the Simple XML Serialization mailing list archive at Nabble.com. |