[squeak-dev] SandstoneDb question

Esteban Lorenzano estebanlm at gmail.com
Mon Aug 25 20:21:35 UTC 2008


Hi,
I'm using SandstoneDb for a project... and I have this (one-to-many) scenario:

a) Product as Parts
b) a Part can be owner by a Product, or can be orphan

so, I have two roots: Product and Part

well, by design, Sandstone does not allow me to make a recursive 
commit, and I have to make that commit by hand, something like this:

self product partsDo: [ :each |
	each isNew ifTrue: [ each commit ].
self product commit.

but... I need this behaivor in many parts of my environment, so I 
rewrited #commit, this way:

Product>>commit
	self partsDo: [ :each |
		each isNew ifTrue: [ each commit ].
	super commit.

My question is: is this design right? Is there another -cleaner- way to 
do this?

Thanks in advance,
Esteban

pd: maybe #commitWithRelations is better than overwrite commit?





More information about the Squeak-dev mailing list