Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
2.0 branch
-
None
-
Arch Linux, Jetty 6.0.2, MySQL 5.0
Description
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.