you're right, i'm still thinking tabularly.
I'm basically looking for ways how to do database query
(select, update, create, etc).
Of course i'm still thinkin in 'relation database' way as
I'm just starting with OODB.
From my latest reading, the ZODB works like a
'dictionary':
-In this way, I can save any objects into this
dictionary.
-the key for the dictionary is the 'unique key' while the
value is the object.
-In order to perform any query, I need to parse through
the dictionary
My questions:
-wouldn't it be too slow?
-How if I don't need any key?
-How if I have multiple keys?
This doesn't seem so easy.
Probably I need to read ZCatalog and get some
understanding from its query.
thanks.
Heri
>
> - I can easily perform SQL
statement to lookup for some information
> such as, total
employee, who are above 30 years old, and who has the
> Lastname
of 'Smith'.
> - I can easily retrieve information from multiple
tables and combine
> it as data objects.
>
> But how can I do this in ZODB?
1) If your data set is
not too big, you can do it programmatically Python:
set =
folder.objectValues()
results = []
for elt in set:
if (elt.age
> 30) and (elt.lastname=='Smith'):
results.append(elt)
return elt
One can easily replace '30' and 'Smith'
with parameters to get a more
useful script.
2) Use ZCatalog for this
if you have larger sets to avoid unnecessary
traversals.
But
I suspect the larger problem is that you're thinking tabularly.
Trying to
make a 1-to-1 translation between an object-storage scheme and
a
relational-storage scheme isn't always (or maybe usually) going to
work. I
know no magic processes for this,
unfortunately.
--jcc