You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Andrus Adamchik <an...@objectstyle.org> on 2015/08/04 11:18:55 UTC
Re: A bunch of stuff is deprecated.
Yeah, that's the new way of doing things. Also check out with ObjectSelect, SelectById and SQLSelect query classes:
https://cayenne.apache.org/docs/4.0/upgrade-guide/ar01.html#framework-api
> On Jul 31, 2015, at 9:43 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>
> Oops, I missed this one.
>
> So
>
> order = new Ordering(Product.NAME_PROPERTY, SortOrder.ASCENDING);
>
> would now be something like:
>
> order = Product.NAME.ascInsensitive();
>
> I think I get it now - that is pretty slick! :)
>
> Joe
>
>
>
>> On Jul 31, 2015, at 1:25 PM, Andrus Adamchik <an...@objectstyle.org> wrote:
>>
>>
>>> On Jul 31, 2015, at 7:50 PM, Joe Baldwin <jf...@earthlink.net> wrote:
>>>
>>> functional replacement that would also give me access to the String value of the property (for display purposes).
>>
>> Here is an example:
>>
>> (generated code)
>>
>> @Deprecated
>> public static final String TITLE_PROPERTY = "title";
>> public static final Property<String> TITLE = new Property<String>("title");
>>
>> (accessing property name in a new way)
>>
>> TITLE.getName();
>>
>> But the point of the new API is to replace code like this:
>>
>> Expression exp = ExpressionFactory.matchExp(Product.IS_DISABLED_PROPERTY, false);
>>
>> with this:
>>
>> Expression exp = Product.IS_DISABLED.isFalse();
>>
>> Which does not require knowing the property name. IIRC 4.0 tutorial has other examples of expressions using the new API.
>>
>> Andrus
>>
>
>