FAQ
Hi All

Using SQL Server I have a table with a DATETIME column. When I run a
Cayenne Query with an Oder By clause in Descending Mode, the resulting
SQL looks something like:

SELECT UPPER(t0.date_created)
FROM product t0
ORDER BY UPPER(t0.date_created) DESC

In the Modeler these columns show up as TIMESTAMP

Is there a reason a UPPER is being used, it seems like it's trying to
do a case insensitive ordering on a non character based column.

Thank you

Gary

Search Discussions

  • Michael Gentry at Aug 6, 2010 at 12:36 pm
    Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?

    mrg

    On Fri, Aug 6, 2010 at 12:10 AM, Gary Jarrel wrote:
    Hi All

    Using SQL Server I have a table with a DATETIME column. When I run a
    Cayenne Query with an Oder By clause in Descending Mode, the resulting
    SQL looks something like:

    SELECT UPPER(t0.date_created)
    FROM product t0
    ORDER BY UPPER(t0.date_created) DESC

    In the Modeler these columns show up as TIMESTAMP

    Is there a reason a UPPER is being used, it seems like it's trying to
    do a case insensitive ordering on a non character based column.

    Thank you

    Gary
  • Martin Weber at Aug 8, 2010 at 10:14 am
    Hi,

    May I suggest to add the Apache Cayenne examples below the success
    stories on the main page or within the success stories. The examples are
    quite hard to find (it's referenced on the cwiki index page) and I could
    find it only through google for apache cayenne examples.

    If possible, somebody could add the link to my project as a further
    example of using cayenne within different technology setups. A link to
    http://yafra.sourceforge.net/ would be excellent. It is yet another
    framework, but not in fact to be reused as such, more to get / take what
    you need to have a better learning curve.

    I used cayenne with the DTO pattern within EJB3 setup serving an Eclipse
    RCP EJB3 fat client (using Apache OpenEJB). As well a small example
    using Apache Wicket with Cayenne. Working on a Google Web Toolkit
    example and would like to move on to Eclipse Riena using distributed
    OSGi (they use Hessian as well, seems to be an interesting example).
    With the yafra framework I did already a ROP example, but not yet
    published. All sources are under SVN as Eclipse projects. I use Trac to
    document.

    You can follow twitter yafraorg or contact yafraorg@gmail.com.

    Cheers,
    Martin
  • Andrus Adamchik at Aug 8, 2010 at 6:59 pm
    Hi Martin,
    May I suggest to add the Apache Cayenne examples below the success
    stories on the main page or within the success stories. The examples
    are quite hard to find (it's referenced on the cwiki index page) and
    I could find it only through google for apache cayenne examples.
    I don't think examples belong on success stories page, as the purpose
    of the later is quite different - to highlight the use of Cayenne on
    some real-life projects. But answering your general point... The
    problem with the examples on cwiki, namely this link - https://cwiki.apache.org/CAY/cayenne-examples.html
    , is that all of those are old, unmaintained (as a matter of fact I
    just removed/changed some links that no longer work), and many are
    likely obsolete.

    This is a #1 link shown to me by Google when searching for "cayenne
    examples", so it is not hard to find per se, but the question is
    whether we want to endorse our old set of examples. I'd say them
    staying a step away from the main site is actually good in current
    situation :-)
    If possible, somebody could add the link to my project as a further
    example of using cayenne within different technology setups. A link
    to http://yafra.sourceforge.net/ would be excellent. It is yet
    another framework, but not in fact to be reused as such, more to
    get / take what you need to have a better learning curve.

    I used cayenne with the DTO pattern within EJB3 setup serving an
    Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small
    example using Apache Wicket with Cayenne. Working on a Google Web
    Toolkit example and would like to move on to Eclipse Riena using
    distributed OSGi (they use Hessian as well, seems to be an
    interesting example). With the yafra framework I did already a ROP
    example, but not yet published. All sources are under SVN as Eclipse
    projects. I use Trac to document.
    Could you provide links to the parts of Yafra that can be used as
    standalone Cayenne examples (does this request even make sense in the
    context of Yafra? Not sure how it is organized) Or maybe alternatively
    you can provide us with a small writeup, explaining those parts that
    we can put on the wiki with links back to the appropriate pieces of
    Yafra?

    Cheers,
    Andrus
  • Martin Weber at Aug 8, 2010 at 8:16 pm
    Hi Andrus,

    agree with your point, wrong location and it is easy to find it in
    google. I still think it would be worth adding a link to
    http://yafra.sourceforge.net/ with a short description like "Using
    Cayenne within different java technologies - a jump start".

    The whole framework is based on Apache Cayenne. My driving point was
    building different applications with a database as central back end.
    Apache Cayenne was the ORM of choice. Instead of building a concrete
    application to share with others, the idea came up to share all the
    findings and the chosen approaches as a sort of a framework. The
    framework shows how I embedded Apache Cayenne into Apache Wicket or in
    simple console/batch programs or with a fat client written in Eclipse
    RCP using EJB's (not using JPA) to access the Cayenne layer.

    I will put some more effort into the trac sourceforge.net page to give a
    better understanding how yafra shall be used.

    Hope it helps,
    Cheers,
    Martin

    On 08.08.2010 20:59, Andrus Adamchik wrote:
    Hi Martin,
    May I suggest to add the Apache Cayenne examples below the success
    stories on the main page or within the success stories. The examples
    are quite hard to find (it's referenced on the cwiki index page) and I
    could find it only through google for apache cayenne examples.
    I don't think examples belong on success stories page, as the purpose of
    the later is quite different - to highlight the use of Cayenne on some
    real-life projects. But answering your general point... The problem with
    the examples on cwiki, namely this link -
    https://cwiki.apache.org/CAY/cayenne-examples.html , is that all of
    those are old, unmaintained (as a matter of fact I just removed/changed
    some links that no longer work), and many are likely obsolete.

    This is a #1 link shown to me by Google when searching for "cayenne
    examples", so it is not hard to find per se, but the question is whether
    we want to endorse our old set of examples. I'd say them staying a step
    away from the main site is actually good in current situation :-)
    If possible, somebody could add the link to my project as a further
    example of using cayenne within different technology setups. A link to
    http://yafra.sourceforge.net/ would be excellent. It is yet another
    framework, but not in fact to be reused as such, more to get / take
    what you need to have a better learning curve.

    I used cayenne with the DTO pattern within EJB3 setup serving an
    Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small
    example using Apache Wicket with Cayenne. Working on a Google Web
    Toolkit example and would like to move on to Eclipse Riena using
    distributed OSGi (they use Hessian as well, seems to be an interesting
    example). With the yafra framework I did already a ROP example, but
    not yet published. All sources are under SVN as Eclipse projects. I
    use Trac to document.
    Could you provide links to the parts of Yafra that can be used as
    standalone Cayenne examples (does this request even make sense in the
    context of Yafra? Not sure how it is organized) Or maybe alternatively
    you can provide us with a small writeup, explaining those parts that we
    can put on the wiki with links back to the appropriate pieces of Yafra?

    Cheers,
    Andrus
  • Andrus Adamchik at Aug 9, 2010 at 11:32 am
    Hi Martin,

    I see. I guess the concept of a "framework as an example" wasn't
    immediately clear to me. Now I added a link to Yafra to the examples
    page. Thanks a lot for your work!

    Andrus

    On Aug 8, 2010, at 11:16 PM, Martin Weber wrote:
    Hi Andrus,

    agree with your point, wrong location and it is easy to find it in
    google. I still think it would be worth adding a link to http://yafra.sourceforge.net/
    with a short description like "Using Cayenne within different java
    technologies - a jump start".

    The whole framework is based on Apache Cayenne. My driving point was
    building different applications with a database as central back end.
    Apache Cayenne was the ORM of choice. Instead of building a concrete
    application to share with others, the idea came up to share all the
    findings and the chosen approaches as a sort of a framework. The
    framework shows how I embedded Apache Cayenne into Apache Wicket or
    in simple console/batch programs or with a fat client written in
    Eclipse RCP using EJB's (not using JPA) to access the Cayenne layer.

    I will put some more effort into the trac sourceforge.net page to
    give a better understanding how yafra shall be used.

    Hope it helps,
    Cheers,
    Martin

    On 08.08.2010 20:59, Andrus Adamchik wrote:
    Hi Martin,
    May I suggest to add the Apache Cayenne examples below the success
    stories on the main page or within the success stories. The examples
    are quite hard to find (it's referenced on the cwiki index page)
    and I
    could find it only through google for apache cayenne examples.
    I don't think examples belong on success stories page, as the
    purpose of
    the later is quite different - to highlight the use of Cayenne on
    some
    real-life projects. But answering your general point... The problem
    with
    the examples on cwiki, namely this link -
    https://cwiki.apache.org/CAY/cayenne-examples.html , is that all of
    those are old, unmaintained (as a matter of fact I just removed/
    changed
    some links that no longer work), and many are likely obsolete.

    This is a #1 link shown to me by Google when searching for "cayenne
    examples", so it is not hard to find per se, but the question is
    whether
    we want to endorse our old set of examples. I'd say them staying a
    step
    away from the main site is actually good in current situation :-)
    If possible, somebody could add the link to my project as a further
    example of using cayenne within different technology setups. A
    link to
    http://yafra.sourceforge.net/ would be excellent. It is yet another
    framework, but not in fact to be reused as such, more to get / take
    what you need to have a better learning curve.

    I used cayenne with the DTO pattern within EJB3 setup serving an
    Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small
    example using Apache Wicket with Cayenne. Working on a Google Web
    Toolkit example and would like to move on to Eclipse Riena using
    distributed OSGi (they use Hessian as well, seems to be an
    interesting
    example). With the yafra framework I did already a ROP example, but
    not yet published. All sources are under SVN as Eclipse projects. I
    use Trac to document.
    Could you provide links to the parts of Yafra that can be used as
    standalone Cayenne examples (does this request even make sense in the
    context of Yafra? Not sure how it is organized) Or maybe
    alternatively
    you can provide us with a small writeup, explaining those parts
    that we
    can put on the wiki with links back to the appropriate pieces of
    Yafra?

    Cheers,
    Andrus
  • Gary Jarrel at Aug 11, 2010 at 12:10 am

    Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?

    mrg
    Yes that is the case, I've just had a look through my code and it is
    being set. The reason though is that we have a small generic DAO
    package which has methods such as

    findObjectsByParameters(Class<T> objectEntity, Map<?, ?> params,
    OrderedMap<String, Boolean> ordering);

    It then build the query and executes it, however by default when
    adding Ordering it uses SortOrder.ASCENDING_INSENSITIVE and
    SortOrder.ASCENDING_INSENSITIVE,

    I would have thought that the the case insensitivity would be applied
    only to String based fields and ignored for Date fields?

    Thank you

    Gary
  • Andrus Adamchik at Aug 11, 2010 at 6:59 am
    I am afraid in this case it is a responsibility of the user to specify
    case sensitivity. Cayenne doesn't try to second guess here.

    Andrus
    On Aug 11, 2010, at 3:10 AM, Gary Jarrel wrote:

    Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?

    mrg
    Yes that is the case, I've just had a look through my code and it is
    being set. The reason though is that we have a small generic DAO
    package which has methods such as

    findObjectsByParameters(Class<T> objectEntity, Map<?, ?> params,
    OrderedMap<String, Boolean> ordering);

    It then build the query and executes it, however by default when
    adding Ordering it uses SortOrder.ASCENDING_INSENSITIVE and
    SortOrder.ASCENDING_INSENSITIVE,

    I would have thought that the the case insensitivity would be applied
    only to String based fields and ignored for Date fields?

    Thank you

    Gary

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedAug 6, '10 at 4:11a
activeAug 11, '10 at 6:59a
posts8
users4
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase