FAQ
Hi community,

I'm trying to receive a SELECT DISTINCT query by a SQLTemplate call, I got
the right count of objects, but all objects are NULL?
I've tried nearly everything, with and without #result directive ...

The strange thing is, that I didn't get any exceptions thrown? Is there a
way to use a deeper logging?

regards
Markus

Search Discussions

  • Andrus Adamchik at Nov 4, 2011 at 12:16 pm
    Hi Markus,

    The observed behavior means that Cayenne doesn't know how to map the result data to a object (we should probably detect this condition and throw an exception, but that's the way it is now).

    You need to ensure that you include all columns that are mapped for a given entity in Cayenne model in your SELECT clause (or do "SELECT * ... "). Once you've done that, another caveat is column name capitalization, so you may have to enforce UPPER or LOWER caps strategy:

    http://cayenne.apache.org/doc30/advanced-sqltemplate.html

    Andrus
    On Nov 4, 2011, at 2:31 AM, Markus Reich wrote:

    Hi community,

    I'm trying to receive a SELECT DISTINCT query by a SQLTemplate call, I got
    the right count of objects, but all objects are NULL?
    I've tried nearly everything, with and without #result directive ...

    The strange thing is, that I didn't get any exceptions thrown? Is there a
    way to use a deeper logging?

    regards
    Markus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 4, '11 at 6:23a
activeNov 4, '11 at 12:16p
posts2
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 1 post Markus Reich: 1 post

People

Translate

site design / logo © 2021 Grokbase