Re: Building a relationship qualifier
Re: Building a relationship qualifier
- Subject: Re: Building a relationship qualifier
- From: Art Isbell <email@hidden>
- Date: Sat, 18 Jan 2003 09:57:42 -1000
On Friday, January 17, 2003, at 05:27 AM, Rajeev Malhotra wrote:
I am new to WO and want to build a qualifier. I have an entity
Department with name and a tomany relationship to Employees. I need to
build a qualifer so that I can select the departments where there is
atleast 1 employee. How do I do that using qualifiers?
Your model should have Department.employees and Employee.department
relationships. Whether both of these is marked as a class property
depends on whether you will need to access both of them in your code.
I'm not certain whether testing for Department.employees being not
null would work because I don't know without setting up a simple test
whether an empty to-many relationship is an empty NSArray or null. So
this qualifier placed on a Department fetch would be "employees !=
null".
It's always instructive to watch the SQL being generated to determine
whether it's correct. To do this, add "-EOAdaptorDebugEnabled true" to
WO app's launch flags. This should be set in any WO app that accesses
a database both to check SQL correctness and to look for unnecessary
database accesses, frequently due to eomodel problems.
Art
http://homepage.mac.com/aisbell/
_______________________________________________
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.