Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limiting EOGenericRecord Relationship with a Session Value?



Hi Paul

I didn't even start with WO yet, therefore I beat you as a clueless newbie ;-)

Yet your question pertains to database design in general and not to a specific software. The questions you should answer therefore are about cardinality:

1 Building has (1..n) Rooms
1 Room belongs to (1*) Building
1 Person has access to (0..n) Rooms and therefore to (0..n) Buildings
1 Room, and therefore to 1 Building, can be accessed by (0..n) Persons

If my interpretation is correct you have a so-called "many to many" relationship between Room and Person, hence you have to create another table in between. Let's call it Access. It can have attributes like: date of beginning and date of termination, and so on.
It's Primary Key can be a compound one: the Person_Foreign_Key and the Room_Foreign_Key together if you DBMS allows it.


Concerning the way to implement it in WO, I'm sorry I can't help you ;-)

Cheers

Nick


Paul Mathews wrote:

Hi all

I was hoping for some advice, being somewhat new to webobjects.

I have a model that is in the form

Building <--->> Room ^ ^
| |
v v
v v
Person_Building Person_Room
^ ^
^ ^
| |
-- > Person <----


Basically a there are many buildings with many rooms in each. A Person can be
granted access to a Building and a limit number of rooms within the building.

No in displaying this I was using a Repetition to display the Buldings in a
list and setting the masterObject to the Person logged in. The Person object
is kept in the Session object.

The problem is when I use a second repetition to display the Rooms for the
build (well that part is easy) but to limit the list of room to the Person
that is logged in is where I am comming apart.bjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Limiting EOGenericRecord Relationship with a Session Value? (From: "Paul Mathews" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.