cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian.E...@gi-de.com
Subject Problem writing java.lang.Long into database
Date Mon, 15 Jan 2007 10:50:51 GMT

Hi,

I have a problem with writing a java.lang.Long into our database.

Example:
I have a value in the database greater than java.lang.Integer.MAX_VALUE,
example 9000000020.
I can read the value correct from the database.

I add 1 to the value (only for the example here), so we have the new value
9000000021 in the Java data object.

After a commit we have the value "410065439" in the database.

This is exactl y the conversion:
      long lo = 9000000021L;
      int val = (int) lo;"

The failure occurs during the write to the database.
I think I have a small mapping problem and could not find the correct way
to map java.lang.Long to our database.
Sorry if a descriptin exist in the documentation, but I didn't found it

Mapping File
      <obj-entity name="Value" className=
"com.gide.pdvcms.bo.commonstore.Value" dbEntityName="VALUES"
            superClassName=
"com.gide.pdvcms.bo.generic.GenericBusinessObject">
        ....
            <obj-attribute name="currentValue" type="java.lang.Long"
db-attribute-path="CURRENT_VALUE"/>
        ....
      </obj-entity>

Environment:
      Oracle 10 g
      cayenne 1.2
      jdk 1.4.2.10

Later I need the same functionality in DB2.

Thanks
Florian


Mime
View raw message