Hi Sabine, 

If Bernat help is not enough, I would like to have some more insight on your 
problem, so If you can put here a better description of your model and the 
problem you are having, I will have a look :)

Esteban

On Jul 19, 2013, at 10:42 AM, Bernat Romagosa <tibabenfortlapala...@gmail.com> 
wrote:

> Hi Sabine!
> 
> If you want an object to be referenced by another, and not embedded in it, 
> you need to give that object root entity. As a root, the object will have a 
> collection of its own, and will be referenced by other objects by id. If the 
> object is not root, it will be embedded inside the referring object as a 
> property.
> 
> So, to be safe, always set #isVoyageRoot to return true at class side of all 
> objects you don't want to have embedded. In general, "big enough" objects who 
> are referenced by different objects should be root.
> 
> In my case, I had a centre which had users which had centres. Users also had 
> projects, and projects also had users. Big mess, I know. Besides that, all 
> users, centres and projects had profiles. My solution was to make centres, 
> projects and users be roots, and let only the profiles be embedded.
> 
> I hope this helped!
> 
> Bernat.
> 
> 
> 2013/7/19 Sabine Knöfel <sabine.knoe...@gmail.com>
> Hi Esteban, 
> 
> yes, now the Rectangle Example works after doing the reset. 
> 
> But saving my model still leads to a non responding image because 
> Voyage is trying to write json for all model stuf deep deep deep and 
> circular. Perhaps same like: 
> http://forum.world.st/Voyage-Circular-references-td4691940.html#a4699436
> 
> I dont know anything about Magritte (yet) and I need a hint what to 
> define in my model so that it stops creating json at certain points 
> and creates only e.g. a Symbol. 
> 
> Example: My model instance  of trip has a connection to an instance of 
> country. The country should not be written in json with all its 
> definitions. Voyage should only write e.g. #germany in the json and 
> later, when getting the instance back from the database, I want to 
> reassign the trip to the country. 
> 
> I already implemented this stuff when working witk Mongotalk the last 
> months and it worked fine. But my question yesterday: 
> http://forum.world.st/MongoDB-open-close-in-production-singleton-or-not-td4699322.html
> lead to my impression that I should use voyage. 
> 
> So, how can I define the "borders"? 
> 
> Sabine 
> 
> On Thu, Jul 18, 2013 at 7:45 PM, EstebanLM [via Smalltalk] 
> <[hidden email]> wrote:
> 
> > Hi Sabine, 
> > 
> > Probably you do not missed anything. 
> > Probably I missed to update the voyage configuration :) 
> > 
> > can you try doing 
> > 
> > VOMongoRepository allInstancesDo: #reset. 
> > 
> > before trying again? 
> > 
> > Cheers, 
> > Esteban 
> > 
> > On Jul 18, 2013, at 6:31 PM, Sabine Knöfel <[hidden email]> wrote: 
> > 
> >> I found this: 
> >> http://smallworks.eu/web/blog/2013-06-14-voyage-the-adventure
> >> 
> >> Chapter "Enhancing storage" 
> >> But if I add the 3+1 methods to Rectangle, and save it again, the json did 
> >> not change. 
> >> 
> >> Did I miss something? 
> >> 
> >> 
> >> 
> >> 
> >> -- 
> >> View this message in context: 
> >> http://forum.world.st/Voyage-Circular-references-tp4691940p4699436.html
> >> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. 
> >> 
> > 
> > 
> > 
> > 
> > ________________________________ 
> > If you reply to this email, your message will be added to the discussion 
> > below: 
> > http://forum.world.st/Voyage-Circular-references-tp4691940p4699443.html
> > To unsubscribe from Voyage: Circular references, click here. 
> > NAML 
> 
> View this message in context: Re: Voyage: Circular references
> 
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> Bernat Romagosa.

Reply via email to