Cached new entity has different primary key type to stored/loaded entity.
-------------------------------------------------------------------------
Key: CAY-768
URL: https://issues.apache.org/cayenne/browse/CAY-768
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 2.0 [STABLE]
Environment: Arch Linux, Jetty 6.0.2, MySQL 5.0
Reporter: Chris Davies
Assigned To: Andrus Adamchik
Priority: Minor
Entities mapped with a primary key type of BIGINT seem to have different types
depending on whether the entity was newly-created (through
DataContext.newObject) or loaded from a database through some query. In my
experience, the primary key type (when looked up using
DataObjectUtils.pkForObject) of a newly-created entity is java.lang.Integer,
where as the primary key type of entities loaded from a database is
java.lang.Long.
I've (temporarily?) fixed the problem in my application by just treating all
entity primary keys as Objects, as I suspect there might be a good reason for
this behaviour that I don't understand yet.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.