Hi,

Does the entity exists? long is initialized with 0 which may be a
valid entity in the store, and Long with null (indicating a new
object...) does not exists.

KlaasJan

On Jan 10, 2008 12:21 AM, Janos Haber <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have a little Entity.
>
> @Entity
> @Table(name = "users")
> public class User {
>
>     @Id
>     @GeneratedValue
>     private Long id;
>
>     private String name;
>     private String password;
> ....
> Setters and getters
> ....
>
> If I use long primitive type, it's work, because if I use Long object
> I get EntityException (I use merge NOT persist).
>
> <openjpa-1.0.1-r420667:592145 nonfatal store error>
> org.apache.openjpa.persistence.EntityExistsException: Attempt to
> persist detached object .....
>  ....
>  hu.javaportal.web.data.dao.UserDAO.merge(UserDAO.java:22)
> ...
>
> UserDAO line 22: return em.merge(obj);
>
> Any idea?
>
> Cow
>

Reply via email to