Hi Theodore,

this is no big deal I hope. First you have to create a model for your
entities, for example with a names-entity, a businessmetadata-entity and a
to-n-relationship from names to businessmetadata (or is it 1:1?). Then you
generate your code and the rest is simple: create a query on the
names-object with 1 qualifier:

new EOKeyValueQualifier("businessmetadata.isCurrent",
EOQualifier.QualifierOperatorEqual, Boolean.True); 

Where businessmetadata is the name of the relationship and isCurrent the
name of the attribute. Hope its right, its just as I am remembering it and
well, its of course simple WO - I am not sure how good you know this stuff
so sorry if I have misunderstood you problem ..

Ciao,
Bjoern 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von
Theodore Petrosky
Gesendet: Montag, 4. Februar 2008 14:58
An: webobjects-dev@lists.apple.com
Betreff: help needed with query

First, most of my experience is with cocoa. I could write any query I wanted
even across relationships. I am having a problem with relationship in WO.

I am starting out with a new simple setup. My db is normalized like this

table names:
firstname text
lastname text
nameid (serial)

namesbusinessmeta:
iscurrent bool  default true
phonenumber text
extension text
nbmid
namesFKid foreign key to names

I have a trigger and function on the db that creates a new insert into
namesbusinessmeta with the referenced foreign key on insert into the names
table.

This works fine.

but now I want to query from my WO app.
select * from names where nameid in (select namesFKid from namesbusinessmeta
where iscurrent = true) order by lastname;

I am lost.... I want an array of current employees where the iscurrent  bool
is in relationship table.

Maybe I am barking up the wrong tree......

Ted








 
____________________________________________________________________________
________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/bw%40condat.de

This email sent to [EMAIL PROTECTED]
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to