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 2020/10/13 06:48:30 UTC

[ANN] Cayenne 4.2.M2 release

4.2.M2 release is out [1]. A few cool things in this release:

* Support for JSON and geospatial value types.
* Ordering on aggregate functions and in-memory evaluation of aggregate expressions.
* Modeler support for downloading JDBC drivers from maven central.
* Runtime changes that may be less obvious to the end user, but allow to handle a variety of edge cases.
* Bug fixes

Also looks like we are pretty close to beta freeze. The main scope of 4.2 is done, though of course improvement ideas keep popping up all the time, especially now that the new stack significantly expanded our SQL vocabulary and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN + DISTINCT for to-many conditions [2].

Enjoy M2!

Andrus

[1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
[2] https://issues.apache.org/jira/browse/CAY-2684

Re: [ANN] Cayenne 4.2.M2 release

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Jeremy, 

Not in 4.2 unfortunately, but all these stack changes take us closer to supporting horizontal inheritance. I am pretty optimistic horizontal will be implemented in 5.0 (and vertical - made much less annoying). 

> If the Cayenne team need helpers / testers / others, just tell me 😁

Much appreciated!

Andrus

> On Oct 13, 2020, at 9:58 AM, Jérémy DE ROYER <je...@ingencys.net> wrote:
> 
> Hello Andrus,
> 
> Is there any plan for horizontal inheritance ? Unfortunately it is a must have for us.
> 
> If the Cayenne team need helpers / testers / others, just tell me 😁
> 
> Many thank's
> 
> Jérémy
> 
>> Le 13 oct. 2020 à 08:48, Andrus Adamchik <an...@objectstyle.org> a écrit :
>> 
>> 4.2.M2 release is out [1]. A few cool things in this release:
>> 
>> * Support for JSON and geospatial value types.
>> * Ordering on aggregate functions and in-memory evaluation of aggregate expressions.
>> * Modeler support for downloading JDBC drivers from maven central.
>> * Runtime changes that may be less obvious to the end user, but allow to handle a variety of edge cases.
>> * Bug fixes
>> 
>> Also looks like we are pretty close to beta freeze. The main scope of 4.2 is done, though of course improvement ideas keep popping up all the time, especially now that the new stack significantly expanded our SQL vocabulary and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN + DISTINCT for to-many conditions [2].
>> 
>> Enjoy M2!
>> 
>> Andrus
>> 
>> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
>> [2] https://issues.apache.org/jira/browse/CAY-2684
> 


Re: [ANN] Cayenne 4.2.M2 release

Posted by Jérémy DE ROYER <je...@ingencys.net>.
Hello Andrus,

Is there any plan for horizontal inheritance ? Unfortunately it is a must have for us.

If the Cayenne team need helpers / testers / others, just tell me 😁

Many thank's

Jérémy

> Le 13 oct. 2020 à 08:48, Andrus Adamchik <an...@objectstyle.org> a écrit :
> 
> 4.2.M2 release is out [1]. A few cool things in this release:
> 
> * Support for JSON and geospatial value types.
> * Ordering on aggregate functions and in-memory evaluation of aggregate expressions.
> * Modeler support for downloading JDBC drivers from maven central.
> * Runtime changes that may be less obvious to the end user, but allow to handle a variety of edge cases.
> * Bug fixes
> 
> Also looks like we are pretty close to beta freeze. The main scope of 4.2 is done, though of course improvement ideas keep popping up all the time, especially now that the new stack significantly expanded our SQL vocabulary and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN + DISTINCT for to-many conditions [2].
> 
> Enjoy M2!
> 
> Andrus
> 
> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
> [2] https://issues.apache.org/jira/browse/CAY-2684


Re: [ANN] Cayenne 4.2.M2 release

Posted by Nikita Timofeev <nt...@objectstyle.com>.
Yes, custom functions and operators should work in the WHERE clause too

    where(TestJson.JSON.operator("->>", String.class, "test").eq("123"))

There won't be as much flexibility as in builtin functions though.

On Tue, Oct 13, 2020 at 11:56 AM Andrus Adamchik <an...@objectstyle.org> wrote:
>
> To expand a bit, Cayenne basically provides a way to map DB-specific JSON columns to "org.apache.cayenne.value.Json". This gives a (hopefully) smooth experience reading and writing such values. How to use it:
>
> 1. Ensure your DB supports native JSON type (e.g. Postgres)
> 2. Map your DbAttribute as type "OTHER"
> 3. Map your ObjAttribute as "org.apache.cayenne.value.Json"
>
> 2 & 3 would happen automatically on reverse-engineering if you are using DB-first flow. "org.apache.cayenne.value.Json" is simply a String wrapper. It intentionally doesn't have any parsing logic. Its purpose is to be a performant dependency-free container to pass JSON payload between the app and DB. If you need JSON as a tree, you may take a few more steps:
>
> 4. Pick a JSON parser such as Jackson.
> 5. Map ObjAttribute as a type supported by that parser (e.g. JsonNode in Jackson)
> 6. Write and register a custom "ValueObjectType<JsonNode, Json>" [1]
> 7. There is even a way to use DB-specific functions to query JSON [2]
>
> @Nikita: is it possible to apply custom functions in the WHERE clause as well?
>
> Andrus
>
> [1] https://cayenne.apache.org/docs/4.2/cayenne-guide/#value-object-type <https://cayenne.apache.org/docs/4.2/cayenne-guide/#value-object-type>
> [2] https://github.com/apache/cayenne-examples/blob/master/cayenne-jdbc-type-other/src/main/java/org/apache/cayenne/demo/JsonTestCommand.java#L59
>
>
>
> > On Oct 13, 2020, at 11:07 AM, Nikita Timofeev <nt...@objectstyle.com> wrote:
> >
> > Hi Markus,
> >
> > No docs for that yet, but here's an example of new types usage:
> >
> > https://github.com/apache/cayenne-examples/tree/master/cayenne-jdbc-type-other
> >
> > On Tue, Oct 13, 2020 at 10:41 AM Markus Reich <re...@gmail.com> wrote:
> >>
> >> Hi Andrus,
> >>
> >> is there an example or doc for the support of JSON types?
> >>
> >> regards
> >> Meex
> >>
> >> Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik <
> >> andrus@objectstyle.org>:
> >>
> >>> 4.2.M2 release is out [1]. A few cool things in this release:
> >>>
> >>> * Support for JSON and geospatial value types.
> >>> * Ordering on aggregate functions and in-memory evaluation of aggregate
> >>> expressions.
> >>> * Modeler support for downloading JDBC drivers from maven central.
> >>> * Runtime changes that may be less obvious to the end user, but allow to
> >>> handle a variety of edge cases.
> >>> * Bug fixes
> >>>
> >>> Also looks like we are pretty close to beta freeze. The main scope of 4.2
> >>> is done, though of course improvement ideas keep popping up all the time,
> >>> especially now that the new stack significantly expanded our SQL vocabulary
> >>> and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN +
> >>> DISTINCT for to-many conditions [2].
> >>>
> >>> Enjoy M2!
> >>>
> >>> Andrus
> >>>
> >>> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
> >>> [2] https://issues.apache.org/jira/browse/CAY-2684
> >>
> >>
> >>
> >> --
> >> *Markus Reich*
> >> Waldweg 62
> >> 6393 St. Ulrich am Pillersee
> >> www.markusreich.at / www.meeximum.at
> >> markus.reich@markusreich.at
> >
> >
> >
> > --
> > Best regards,
> > Nikita Timofeev
>


-- 
Best regards,
Nikita Timofeev

Re: [ANN] Cayenne 4.2.M2 release

Posted by Andrus Adamchik <an...@objectstyle.org>.
To expand a bit, Cayenne basically provides a way to map DB-specific JSON columns to "org.apache.cayenne.value.Json". This gives a (hopefully) smooth experience reading and writing such values. How to use it:

1. Ensure your DB supports native JSON type (e.g. Postgres)
2. Map your DbAttribute as type "OTHER" 
3. Map your ObjAttribute as "org.apache.cayenne.value.Json"

2 & 3 would happen automatically on reverse-engineering if you are using DB-first flow. "org.apache.cayenne.value.Json" is simply a String wrapper. It intentionally doesn't have any parsing logic. Its purpose is to be a performant dependency-free container to pass JSON payload between the app and DB. If you need JSON as a tree, you may take a few more steps:

4. Pick a JSON parser such as Jackson.
5. Map ObjAttribute as a type supported by that parser (e.g. JsonNode in Jackson)
6. Write and register a custom "ValueObjectType<JsonNode, Json>" [1]
7. There is even a way to use DB-specific functions to query JSON [2] 

@Nikita: is it possible to apply custom functions in the WHERE clause as well?

Andrus

[1] https://cayenne.apache.org/docs/4.2/cayenne-guide/#value-object-type <https://cayenne.apache.org/docs/4.2/cayenne-guide/#value-object-type>
[2] https://github.com/apache/cayenne-examples/blob/master/cayenne-jdbc-type-other/src/main/java/org/apache/cayenne/demo/JsonTestCommand.java#L59



> On Oct 13, 2020, at 11:07 AM, Nikita Timofeev <nt...@objectstyle.com> wrote:
> 
> Hi Markus,
> 
> No docs for that yet, but here's an example of new types usage:
> 
> https://github.com/apache/cayenne-examples/tree/master/cayenne-jdbc-type-other
> 
> On Tue, Oct 13, 2020 at 10:41 AM Markus Reich <re...@gmail.com> wrote:
>> 
>> Hi Andrus,
>> 
>> is there an example or doc for the support of JSON types?
>> 
>> regards
>> Meex
>> 
>> Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik <
>> andrus@objectstyle.org>:
>> 
>>> 4.2.M2 release is out [1]. A few cool things in this release:
>>> 
>>> * Support for JSON and geospatial value types.
>>> * Ordering on aggregate functions and in-memory evaluation of aggregate
>>> expressions.
>>> * Modeler support for downloading JDBC drivers from maven central.
>>> * Runtime changes that may be less obvious to the end user, but allow to
>>> handle a variety of edge cases.
>>> * Bug fixes
>>> 
>>> Also looks like we are pretty close to beta freeze. The main scope of 4.2
>>> is done, though of course improvement ideas keep popping up all the time,
>>> especially now that the new stack significantly expanded our SQL vocabulary
>>> and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN +
>>> DISTINCT for to-many conditions [2].
>>> 
>>> Enjoy M2!
>>> 
>>> Andrus
>>> 
>>> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
>>> [2] https://issues.apache.org/jira/browse/CAY-2684
>> 
>> 
>> 
>> --
>> *Markus Reich*
>> Waldweg 62
>> 6393 St. Ulrich am Pillersee
>> www.markusreich.at / www.meeximum.at
>> markus.reich@markusreich.at
> 
> 
> 
> -- 
> Best regards,
> Nikita Timofeev


Re: [ANN] Cayenne 4.2.M2 release

Posted by Nikita Timofeev <nt...@objectstyle.com>.
Hi Markus,

No docs for that yet, but here's an example of new types usage:

https://github.com/apache/cayenne-examples/tree/master/cayenne-jdbc-type-other

On Tue, Oct 13, 2020 at 10:41 AM Markus Reich <re...@gmail.com> wrote:
>
> Hi Andrus,
>
> is there an example or doc for the support of JSON types?
>
> regards
> Meex
>
> Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik <
> andrus@objectstyle.org>:
>
> > 4.2.M2 release is out [1]. A few cool things in this release:
> >
> > * Support for JSON and geospatial value types.
> > * Ordering on aggregate functions and in-memory evaluation of aggregate
> > expressions.
> > * Modeler support for downloading JDBC drivers from maven central.
> > * Runtime changes that may be less obvious to the end user, but allow to
> > handle a variety of edge cases.
> > * Bug fixes
> >
> > Also looks like we are pretty close to beta freeze. The main scope of 4.2
> > is done, though of course improvement ideas keep popping up all the time,
> > especially now that the new stack significantly expanded our SQL vocabulary
> > and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN +
> > DISTINCT for to-many conditions [2].
> >
> > Enjoy M2!
> >
> > Andrus
> >
> > [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
> > [2] https://issues.apache.org/jira/browse/CAY-2684
>
>
>
> --
> *Markus Reich*
> Waldweg 62
> 6393 St. Ulrich am Pillersee
> www.markusreich.at / www.meeximum.at
> markus.reich@markusreich.at



-- 
Best regards,
Nikita Timofeev

Re: [ANN] Cayenne 4.2.M2 release

Posted by Markus Reich <re...@gmail.com>.
Hi Andrus,

is there an example or doc for the support of JSON types?

regards
Meex

Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik <
andrus@objectstyle.org>:

> 4.2.M2 release is out [1]. A few cool things in this release:
>
> * Support for JSON and geospatial value types.
> * Ordering on aggregate functions and in-memory evaluation of aggregate
> expressions.
> * Modeler support for downloading JDBC drivers from maven central.
> * Runtime changes that may be less obvious to the end user, but allow to
> handle a variety of edge cases.
> * Bug fixes
>
> Also looks like we are pretty close to beta freeze. The main scope of 4.2
> is done, though of course improvement ideas keep popping up all the time,
> especially now that the new stack significantly expanded our SQL vocabulary
> and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN +
> DISTINCT for to-many conditions [2].
>
> Enjoy M2!
>
> Andrus
>
> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
> [2] https://issues.apache.org/jira/browse/CAY-2684



-- 
*Markus Reich*
Waldweg 62
6393 St. Ulrich am Pillersee
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: [ANN] Cayenne 4.2.M2 release

Posted by Markus Reich <re...@gmail.com>.
Hi Andrus,

is there an example or doc for the support of JSON types?

regards
Meex

Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik <
andrus@objectstyle.org>:

> 4.2.M2 release is out [1]. A few cool things in this release:
>
> * Support for JSON and geospatial value types.
> * Ordering on aggregate functions and in-memory evaluation of aggregate
> expressions.
> * Modeler support for downloading JDBC drivers from maven central.
> * Runtime changes that may be less obvious to the end user, but allow to
> handle a variety of edge cases.
> * Bug fixes
>
> Also looks like we are pretty close to beta freeze. The main scope of 4.2
> is done, though of course improvement ideas keep popping up all the time,
> especially now that the new stack significantly expanded our SQL vocabulary
> and JDBC capabilities. E.g. one such idea is using EXISTS instead of JOIN +
> DISTINCT for to-many conditions [2].
>
> Enjoy M2!
>
> Andrus
>
> [1] https://cayenne.apache.org/2020/10/cayenne-42m2-released/
> [2] https://issues.apache.org/jira/browse/CAY-2684



-- 
*Markus Reich*
Waldweg 62
6393 St. Ulrich am Pillersee
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at