cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Property expressions, Was: API for aggregate and non aggregate SQL functions
Date Tue, 10 Jan 2017 02:27:03 GMT
On 9/1/17 8:45pm, Nikita Timofeev wrote:
>> Could that syntax above could be cleaner like:
>>    Property<Integer> nameLength = Artist.ARTIST_NAME.function(Expression.SQL_LENGTH)
>> or is that just going to result in a whole lot of clutter in the class?
> Such methods will create too much coupling between properties and
> functions, I'm afraid,
> as Property class would know about all SQL functions and their arguments.

I'm not convinced that all the SQL specific code would land in the Property class. That would
be a wrapper to the factory methods elsewhere.

I'm not sure the enum approach above is the cleanest, but some shorter simpler API which still
gives us the correct Property<Integer> generics would be nice.


Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

View raw message