cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Zeigler <robert.zeig...@gmail.com>
Subject Re: Qualifier Expression
Date Sat, 14 Mar 2009 19:53:05 GMT
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<Entity1> e1 = objectContext.performQuery(query);//note: perform  
query is NOT generified, so you'll get a warning here.

Robert

On Mar 14, 2009, at 3/141:29 PM , Joe Baldwin wrote:

> 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 SELECT Query with a filter  
> on one of the fields of the relationship-entity (E2.F1) and return a  
> list of the first entity (E1List).
>
> What is the most efficient Cayenne way to do this?  (I am still a  
> bit confused concerning how to construct efficient queries in the  
> object domain vs the relational domain.)
>
> Thanks,
> Joe
>
>
>


Mime
View raw message