openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2443) InvalidStateException while merging a new Entity with a GeneratedValue id
Date Tue, 22 Oct 2013 21:29:49 GMT
Rick Curtis created OPENJPA-2443:

             Summary: InvalidStateException while merging a new Entity with a GeneratedValue
                 Key: OPENJPA-2443
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 2.3.0, 2.4.0
            Reporter: Rick Curtis
            Assignee: Rick Curtis

This problem only happens if you have an Entity with a Generated id that also has the annotation
@Basic(optional = false). If you create a new Entity and then try to persist it via EntityManager.merge(...)
call, you'll get the following stack :

<openjpa-0.0.0-rnull fatal user error> org.apache.openjpa.persistence.InvalidStateException:
The field "id" of instance ""
contained a null value; the metadata for this field specifies that nulls are illegal.
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
	at org.apache.openjpa.kernel.SingleFieldManager.preFlush(
	at org.apache.openjpa.kernel.StateManagerImpl.preFlush(
	at org.apache.openjpa.kernel.PNewState.beforeFlush(
	at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(
	at org.apache.openjpa.kernel.BrokerImpl.flush(
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(
	at org.apache.openjpa.kernel.BrokerImpl.flush(
	at org.apache.openjpa.kernel.DelegatingBroker.flush(
	at org.apache.openjpa.persistence.EntityManagerImpl.flush(

This message was sent by Atlassian JIRA

View raw message