cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <h...@karlmenn.is>
Subject Re: Type safe queries & more
Date Sun, 18 Sep 2011 11:37:42 GMT
I actually started out with a ChainableExpression, but I had problems creating a wrapper for
an Expression since Expression has a couple of protected methods that required overriding
in a subclass. Simple to get around, I guess, but I haven't had the time to check it out again
:).

But that's definitely desirable, so you can write, as you say expression.count( ObjectContext
) or expression.fetch( ObjectContext ).

Cheers,
- hugi



On 18.9.2011, at 11:12, Aristedes Maniatis wrote:

> On 16/09/11 11:36 PM, Hugi Thordarson wrote:
>> We've committed the code as a Maven project on Bitbucket:
>> 
>> https://bitbucket.org/hugi/jambalaya
> 
> I'm curious about your choice to create ChainableOrdering and not ChainableExpression.
The later would let us equally write:
> 
>  debtors = User.where("owing > 0").order("firstname")
> 
> and then later on
> 
>  debtors.count()
> 
> or
> 
>  debtors.where("firstname LIKE joe%")
> 
> 
> Adding an ordering to an expression need not then preclude adding further WHERE clauses.
> 
> 
> Ari
> 
> -- 
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A


Mime
View raw message