[Seaside] Slightly OT -- Glorp session question..

Boris Popov boris at deepcovelabs.com
Fri Jun 30 16:52:52 UTC 2006


Typically instead of a single descriptor you create descriptor systems that
describe your whole domain by subclassing DescriptorSystem and then creating
your session via,

system := MyDescriptorSystem forPlatform: login database.
session := GlorpSession new.
session accessor: (DatabaseAccessor forLogin: login).
session system: system. 

There should be plenty of examples in GlorpTest for this.

Hope this helps,

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

boris at deepcovelabs.com

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Rick Flower
Sent: Friday, June 30, 2006 9:44 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: Re: [Seaside] Slightly OT -- Glorp session question..

Boris Popov wrote:
> I'm not sure what you mean by session knowing the tables. You can use the
> session to query your domain objects via,
>
> self session readManyOf: User
>
> self session readManyOf: User where: [:usr | user username = supplied]
>
> etc
>
> But I suspect I may be missing something, so if you could clarify your
> question, that would help,
>   
Boris --

Below is how my db connection is setup :
          [ login code is skipped for this ]
            db := Glorp.GlorpSession new.
            db system: (MSADBUserDescriptor forPlatform: login database).
            db accessor: accessor

Once I do that I can issue the following and get an array of users:
    users := db readManyOf: MSADBUser.

However, if I want to read one of the other tables using something like 
the following:
    states := db readManyOf: MSADBLocationLookup.

I get an exception "Message not understood: 
#classesRequiringIndependentQueries"

So, I'm guessing I need to use some other Glorp mechanism or change my 
"db system: ..." line
from above to add more descriptors for other tables I might be reading 
during the same Seaside
session or same Glorp session.. Am I barking up the right tree here?

TIA!

-- Rick
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3370 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20060630/c1c2c962/smime.bin


More information about the Seaside mailing list