[ 
https://issues.apache.org/jira/browse/OPENJPA-2290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-2290.
--------------------------------------
    Resolution: Fixed

Already fixed on master: 67c6a78eb (on master): BrokerImpl.isDetached now 
returns false without a find when isIdentityAssigned sees a null PK field 
(BrokerImpl.java:4943-4946,4957). Closing; please reopen if this still happens 
with OpenJPA 4.x.

> 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 was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to