Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-329

Long vs. Integer PK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1 [LEGACY], 1.2 branch
    • 3.0M3
    • Core Library
    • None

    Description

      Test suite submitted by Mikaƫl Cluseau:

      http://www.objectstyle.org/cayenne/lists/cayenne-devel/2005/06/0036.html

      fails when an object is created, committed and then updated and committed. SQL UPDATE updates an ID value for no good reason. My investigation shows that this is due to Integer vs. Long PK... BIGINT PK columns default mapping is Long per JDBC standard. So on fetch it is converted to Long. PK generator on the other hand has a hardcoded behavior to create Integer ... So two values behave as if they are non-equal and generate a bogus update. We need to fix PK generator to use default JDBC to java mapping instead of assuming Integer.

      Similar situation has been discussed before:

      http://www.objectstyle.org/cayenne/lists/cayenne-devel/2005/03/0086.html

      Attachments

        Issue Links

          Activity

            People

              andrus Andrus Adamchik
              andrus Andrus Adamchik
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: