FAQ
Trying to use the latest trunk code, I came across some behavior that
has changed. I used to be able to pass DataObjectUtils.objectForPK a
primary key that was a String, and Cayenne would automatically
typecast this to the real PK type (such as String -> Integer). Now it
seems like the typecasting does not occur, causing an exception on the
query with my database.

Was this change intentional? If not, I'll open a bug report with more detail.

-Dave

Search Discussions

  • Andrus Adamchik at Sep 27, 2009 at 1:34 pm
    I don't recall an intentional change to disable automated type
    conversion. It was not supported before, so I guess it was purely
    coincidental that it worked on a particular database with a particular
    driver.

    Andrus
    On Sep 25, 2009, at 11:46 AM, Dave Dombrosky wrote:

    Trying to use the latest trunk code, I came across some behavior that
    has changed. I used to be able to pass DataObjectUtils.objectForPK a
    primary key that was a String, and Cayenne would automatically
    typecast this to the real PK type (such as String -> Integer). Now it
    seems like the typecasting does not occur, causing an exception on the
    query with my database.

    Was this change intentional? If not, I'll open a bug report with
    more detail.

    -Dave
  • Dave Dombrosky at Oct 30, 2009 at 10:40 am
    Andrus,

    I finally looked into this, and I found the problem. I opened up
    https://issues.apache.org/jira/browse/CAY-1298 for the bug. It's not
    a major regression, but it could be annoying for users upgrading from
    earlier versions of Cayenne.

    -Dave
    On Sun, Sep 27, 2009 at 9:34 AM, Andrus Adamchik wrote:
    I don't recall an intentional change to disable automated type conversion.
    It was not supported before, so I guess it was purely coincidental that it
    worked on a particular database with a particular driver.

    Andrus
    On Sep 25, 2009, at 11:46 AM, Dave Dombrosky wrote:

    Trying to use the latest trunk code, I came across some behavior that
    has changed.  I used to be able to pass DataObjectUtils.objectForPK a
    primary key that was a String, and Cayenne would automatically
    typecast this to the real PK type (such as String -> Integer).  Now it
    seems like the typecasting does not occur, causing an exception on the
    query with my database.

    Was this change intentional?  If not, I'll open a bug report with more
    detail.

    -Dave
  • Andrus Adamchik at Oct 30, 2009 at 2:29 pm
    Hi Dave,

    thanks for tracking this down. Now that you've mentioned a specific
    commit, it all makes sense to me know. My take on this though is that
    it is working correctly now, and was working before purely by
    accident. So I guess I'll just add a note to the UPGRADE-NOTES.txt,
    but I don't think we should roll back this behavior.

    BTW going through my mailbox, I've seen the exact same PG Exception
    when trying to bind a String to a boolean parameter back in July 2007.
    So we are actually getting more consistent now, with all types working
    the same way.

    Andrus
    On Oct 30, 2009, at 12:40 PM, Dave Dombrosky wrote:
    Andrus,

    I finally looked into this, and I found the problem. I opened up
    https://issues.apache.org/jira/browse/CAY-1298 for the bug. It's not
    a major regression, but it could be annoying for users upgrading from
    earlier versions of Cayenne.

    -Dave

    On Sun, Sep 27, 2009 at 9:34 AM, Andrus Adamchik <andrus@objectstyle.org
    wrote:
    I don't recall an intentional change to disable automated type
    conversion.
    It was not supported before, so I guess it was purely coincidental
    that it
    worked on a particular database with a particular driver.

    Andrus
    On Sep 25, 2009, at 11:46 AM, Dave Dombrosky wrote:

    Trying to use the latest trunk code, I came across some behavior
    that
    has changed. I used to be able to pass
    DataObjectUtils.objectForPK a
    primary key that was a String, and Cayenne would automatically
    typecast this to the real PK type (such as String -> Integer).
    Now it
    seems like the typecasting does not occur, causing an exception on
    the
    query with my database.

    Was this change intentional? If not, I'll open a bug report with
    more
    detail.

    -Dave

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedSep 25, '09 at 8:47a
activeOct 30, '09 at 2:29p
posts4
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 2 posts Dave Dombrosky: 2 posts

People

Translate

site design / logo © 2022 Grokbase