Re: Qualifier Expression

2009-03-14 Thread Joe Baldwin
Robert, Now I get it; Cayenne is totally cool!! :) Here is the code I used: ObjectContext oc = BaseContext.getThreadObjectContext(); Expression exp = ExpressionFactory.likeIgnoreCaseExp("billAddress.lastName", "%clapt%"); SelectQuery query = new SelectQuery(Customer.class, ex

Re: Qualifier Expression

2009-03-14 Thread Dave Lamy
Here's what I would do: 1) Tables set up as you describe. CUSTOMER would have a BILL_ADDRESS_ID and a SHIP_ADDRESS_ID, both of which are FK references to the ADDRESS table. 2) Set up DB joins from Customer to Address, and vice-versa. 3) Set up ObjEntities for Customer and Address, and create Ob

Re: Qualifier Expression

2009-03-14 Thread Robert Zeigler
On Mar 14, 2009, at 3/144:22 PM , Joe Baldwin wrote: Robert, I am attempting a test but lost you on your Qualifier step. SelectQuery query = new SelectQuery(Entity1.class); This is easy. query.setQualifier(ExpressionFactory.matchExp(Entity1.EN| TITY2_PROPERTY,entity2));//where ENTITY2_PR

Re: Qualifier Expression

2009-03-14 Thread Joe Baldwin
Robert, Here is the working SQL select customer.billAddressOID, custAddress.oid, customerID, lastName from customer, custAddress where customer.billAddressOID = custAddress.oid; This SQL returns the result set that I am needing. My brain is stuck in SQL, and I am trying to train mysel

Re: Qualifier Expression

2009-03-14 Thread Joe Baldwin
Robert, I am attempting a test but lost you on your Qualifier step. SelectQuery query = new SelectQuery(Entity1.class); This is easy. query.setQualifier(ExpressionFactory.matchExp(Entity1.EN| TITY2_PROPERTY,entity2));//where ENTITY2_PROPERTY is the name of object property in entity1 that

Re: Qualifier Expression

2009-03-14 Thread Robert Zeigler
Hi Joe, How about: SelectQuery query = new SelectQuery(Entity1.class); query.setQualifier(ExpressionFactory.matchExp(Entity1.EN| TITY2_PROPERTY,entity2));//where ENTITY2_PROPERTY is the name of object property in entity1 that points to entity2 List e1 = objectContext.performQuery(query);//not

Qualifier Expression

2009-03-14 Thread Joe Baldwin
I am attempting to create the simplest Cayenne-expedient method of doing the following query. (I can easily do this in SQL but am a tad confused with the Cayenne Expression method.) I have an Entity (E1) with a one to one relationship with a second entity (E2). I would like to perform a SE