FAQ
Hi all.

Since converting Expressions that use outer joins to EJBQL doesn’t work in Cayenne, I find myself now using somewhat kludgy methods to invoke aggregate methods (for example to retrieve the count of records that an expression will yield).

Does anyone have a good solution or is there a standard way to do this?

Cheers,
- hugi

// Hugi Thordarson
// http://www.loftfar.is/ <http://www.loftfar.is/>
// s. 895-6688

Search Discussions

  • Andrus Adamchik at Sep 13, 2015 at 7:02 pm
    Hi Hugi,

    This was a big enough hole in the API, that I felt it needed fixing. I just added support for the "path+" EJBQL syntax to Cayenne per https://issues.apache.org/jira/browse/CAY-2027 . So you can build Cayenne from master and use it right away.

    Andrus

    On Sep 12, 2015, at 9:03 AM, Hugi Thordarson wrote:

    Hi all.

    Since converting Expressions that use outer joins to EJBQL doesn’t work in Cayenne, I find myself now using somewhat kludgy methods to invoke aggregate methods (for example to retrieve the count of records that an expression will yield).

    Does anyone have a good solution or is there a standard way to do this?

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688
  • Hugi Thordarson at Sep 13, 2015 at 7:27 pm
    Hi Andrus.

    Words can't describe how happy I am with your helpfulness and the general niceness of the Cayenne community. I fully realize you’re putting in free work for me to benefit from.

    I've started working on a proposal for the WebObjects-world to migrate Project Wonder to Cayenne, or at least put EOF and Cayenne functionality in separate frameworks so people can easily choose between frameworks and migrate old code. I think there’s a great opportunity there to help out developers that are anxious to move forward with projects that are stuck in what’s essentially a dead ecosystem. I want to be a little more familiar with Cayenne before suggesting such a thing, though, since I want to be able to help out with the migration and the flood of users that will hopefully follow.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 13. sep. 2015, at 19:02, Andrus Adamchik wrote:

    Hi Hugi,

    This was a big enough hole in the API, that I felt it needed fixing. I just added support for the "path+" EJBQL syntax to Cayenne per https://issues.apache.org/jira/browse/CAY-2027 . So you can build Cayenne from master and use it right away.

    Andrus

    On Sep 12, 2015, at 9:03 AM, Hugi Thordarson wrote:

    Hi all.

    Since converting Expressions that use outer joins to EJBQL doesn’t work in Cayenne, I find myself now using somewhat kludgy methods to invoke aggregate methods (for example to retrieve the count of records that an expression will yield).

    Does anyone have a good solution or is there a standard way to do this?

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688
  • Aristedes Maniatis at Sep 13, 2015 at 11:43 pm

    On 14/09/2015 5:26am, Hugi Thordarson wrote:
    I've started working on a proposal for the WebObjects-world to migrate Project Wonder to Cayenne,
    Sounds great. Its been a long time since I was in the WO world, and although I used Project Wonder way back then, I find it hard to remember where EOF stopped and Wonder started.

    Can you give us a short summary of what features Wonder would bring to a Cayenne developer?

    Cheers
    Ari

    --
    -------------------------->
    Aristedes Maniatis
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
  • Hugi Thordarson at Sep 14, 2015 at 9:37 am

    I've started working on a proposal for the WebObjects-world to migrate Project Wonder to Cayenne,
    Sounds great. Its been a long time since I was in the WO world, and although I used Project Wonder way back then, I find it hard to remember where EOF stopped and Wonder started.
    That’s understandable, Wonder is mostly a place for users to extend and enhance WO and EOF since official development on these frameworks stalled almost a decade ago.

    Can you give us a short summary of what features Wonder would bring to a Cayenne developer?
    Since Wonder is targeted towards WebObjects development I don’t think the typical Cayenne developer will gain a lot of features at first (unless he's using WO). But there’s quite an active and passionate developer community working on Wonder that I think could provide a great deal of energy and would contribute to the development of Cayenne. So I think what Cayenne has to gain is more in terms of energy, community and mindshare than code.

    Cheers,
    - hugi
  • Andrus Adamchik at Sep 14, 2015 at 1:41 pm

    On Sep 14, 2015, at 5:37 AM, Hugi Thordarson wrote:
    Can you give us a short summary of what features Wonder would bring to a Cayenne developer?
    Since Wonder is targeted towards WebObjects development I don’t think the typical Cayenne developer will gain a lot of features at first (unless he's using WO). But there’s quite an active and passionate developer community working on Wonder that I think could provide a great deal of energy and would contribute to the development of Cayenne. So I think what Cayenne has to gain is more in terms of energy, community and mindshare than code.
    Yep, my thoughts exactly. WO folks coming to Cayenne all these years brought lots of energy and ideas. I hope they keep coming here :)

    Andrus
  • Joseph Senecal at Sep 14, 2015 at 8:42 pm
    Can you give us a short summary of what features Wonder would bring to a Cayenne developer?
    My favorite Project Wonder extension for EOF would be the automatically generated ERXKeys.

    The Project Wonder template would generate a base class with all the getters and setters for a class (business logic would be in the super class). In addition to the getters and setters, these base classes included fetch methods that returned a List of that class type instead of an untyped list. Also they included an ERXKey for each field or relation in the class.

    ERXKeys could be used to easily generate qualifiers (Queries) or sort orderings. These could easily be combined to generate more complex queries. In addition, ERXKeys could be used to fetch a particular field out of every record in a list of DB objects, returning a list of values. And since the ERXKey was defined with the field type, the returned list was correctly typed.

    Example:
    List<Foobar> data = Foobar.fetch(Foobar.FOO.eq(10).and(Foobar.BAR.eq(“NOW”)));
    List<String> fieldData = Foobar.FOO_BAR.arrayValueInObject(data);

    Joe
  • John Huss at Sep 15, 2015 at 12:38 am
    ERXKey is in cayenne 4.0 and is called Property and the default templates
    create them for you.
    On Mon, Sep 14, 2015 at 3:42 PM Joseph Senecal wrote:


    Can you give us a short summary of what features Wonder would bring to a
    Cayenne developer?

    My favorite Project Wonder extension for EOF would be the automatically
    generated ERXKeys.

    The Project Wonder template would generate a base class with all the
    getters and setters for a class (business logic would be in the super
    class). In addition to the getters and setters, these base classes included
    fetch methods that returned a List of that class type instead of an untyped
    list. Also they included an ERXKey for each field or relation in the class.

    ERXKeys could be used to easily generate qualifiers (Queries) or sort
    orderings. These could easily be combined to generate more complex queries.
    In addition, ERXKeys could be used to fetch a particular field out of every
    record in a list of DB objects, returning a list of values. And since the
    ERXKey was defined with the field type, the returned list was correctly
    typed.

    Example:
    List<Foobar> data =
    Foobar.fetch(Foobar.FOO.eq(10).and(Foobar.BAR.eq(“NOW”)));
    List<String> fieldData = Foobar.FOO_BAR.arrayValueInObject(data);

    Joe
  • Mike Kienenberger at Sep 14, 2015 at 3:04 pm
    There's a lot of ex-EOF/ex-WO folks involved with this project (including me).

    Do we still have the model converter out there? When I started using
    Cayenne back in the 1.1 days, we had a converter tool that would
    create a cayenne project out of an EOF project. I'm not sure if it's
    still around or if it needs to be updated -- even back then there were
    some rough edges.

    On Sun, Sep 13, 2015 at 3:26 PM, Hugi Thordarson wrote:
    Hi Andrus.

    Words can't describe how happy I am with your helpfulness and the general niceness of the Cayenne community. I fully realize you’re putting in free work for me to benefit from.

    I've started working on a proposal for the WebObjects-world to migrate Project Wonder to Cayenne, or at least put EOF and Cayenne functionality in separate frameworks so people can easily choose between frameworks and migrate old code. I think there’s a great opportunity there to help out developers that are anxious to move forward with projects that are stuck in what’s essentially a dead ecosystem. I want to be a little more familiar with Cayenne before suggesting such a thing, though, since I want to be able to help out with the migration and the flood of users that will hopefully follow.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 13. sep. 2015, at 19:02, Andrus Adamchik wrote:

    Hi Hugi,

    This was a big enough hole in the API, that I felt it needed fixing. I just added support for the "path+" EJBQL syntax to Cayenne per https://issues.apache.org/jira/browse/CAY-2027 . So you can build Cayenne from master and use it right away.

    Andrus

    On Sep 12, 2015, at 9:03 AM, Hugi Thordarson wrote:

    Hi all.

    Since converting Expressions that use outer joins to EJBQL doesn’t work in Cayenne, I find myself now using somewhat kludgy methods to invoke aggregate methods (for example to retrieve the count of records that an expression will yield).

    Does anyone have a good solution or is there a standard way to do this?

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688
  • Andrus Adamchik at Sep 14, 2015 at 5:23 pm

    Do we still have the model converter out there? We do.
    even back then there were some rough edges.
    And there are :)

    Andrus
    On Sep 14, 2015, at 11:04 AM, Mike Kienenberger wrote:

    There's a lot of ex-EOF/ex-WO folks involved with this project (including me).

    Do we still have the model converter out there? When I started using
    Cayenne back in the 1.1 days, we had a converter tool that would
    create a cayenne project out of an EOF project. I'm not sure if it's
    still around or if it needs to be updated -- even back then there were
    some rough edges.

    On Sun, Sep 13, 2015 at 3:26 PM, Hugi Thordarson wrote:
    Hi Andrus.

    Words can't describe how happy I am with your helpfulness and the general niceness of the Cayenne community. I fully realize you’re putting in free work for me to benefit from.

    I've started working on a proposal for the WebObjects-world to migrate Project Wonder to Cayenne, or at least put EOF and Cayenne functionality in separate frameworks so people can easily choose between frameworks and migrate old code. I think there’s a great opportunity there to help out developers that are anxious to move forward with projects that are stuck in what’s essentially a dead ecosystem. I want to be a little more familiar with Cayenne before suggesting such a thing, though, since I want to be able to help out with the migration and the flood of users that will hopefully follow.

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688


    On 13. sep. 2015, at 19:02, Andrus Adamchik wrote:

    Hi Hugi,

    This was a big enough hole in the API, that I felt it needed fixing. I just added support for the "path+" EJBQL syntax to Cayenne per https://issues.apache.org/jira/browse/CAY-2027 . So you can build Cayenne from master and use it right away.

    Andrus

    On Sep 12, 2015, at 9:03 AM, Hugi Thordarson wrote:

    Hi all.

    Since converting Expressions that use outer joins to EJBQL doesn’t work in Cayenne, I find myself now using somewhat kludgy methods to invoke aggregate methods (for example to retrieve the count of records that an expression will yield).

    Does anyone have a good solution or is there a standard way to do this?

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688
  • Michael Gentry at Sep 14, 2015 at 1:53 pm
    Hi Hugi, if you are using an older Cayenne (3.0/3.1), I have a set of
    utility functions to do count/sum/avg/min/max with expressions. If using a
    newer version, perhaps Andrus' changes will help you. Let me know if you
    want the older versions.

    mrg

    On Sat, Sep 12, 2015 at 9:03 AM, Hugi Thordarson wrote:

    Hi all.

    Since converting Expressions that use outer joins to EJBQL doesn’t work in
    Cayenne, I find myself now using somewhat kludgy methods to invoke
    aggregate methods (for example to retrieve the count of records that an
    expression will yield).

    Does anyone have a good solution or is there a standard way to do this?

    Cheers,
    - hugi

    // Hugi Thordarson
    // http://www.loftfar.is/ <http://www.loftfar.is/>
    // s. 895-6688

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedSep 12, '15 at 1:04p
activeSep 15, '15 at 12:38a
posts11
users7
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase