openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chunlinyao (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENJPA-2290) merge new entity will search DB with 0 entity id.
Date Sun, 04 Nov 2012 05:27:13 GMT
chunlinyao created OPENJPA-2290:
-----------------------------------

             Summary: merge new entity will search DB with 0 entity id.
                 Key: OPENJPA-2290
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2290
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.2.0
            Reporter: chunlinyao
            Priority: Minor


I have a entity with Long id. When I merge a new entity. OpenJPA always query db with id =
0.
The new entity's id == null, Why it query the db and translate the null to 0?

The ApplicationIds.create() returns 0 LongId on a pc with null id. This cause openjpa query
db with 0 id. When there have a id==0 entity in the db you will have some trouble.

If I use GenerateType.IDENTITY with hsqldb, the id will generated start from 0. So If I run
merge(new Entity()) two times, I only got one entity.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message