Hello users,

due the circumstances I need to use openjpa 1.0.4.
I've an entity where the Id will be generated by a sequence. I create an new
instance of the entity and call entityManager.persist(instance).

I get next exception

org.springframework.orm.jpa.JpaSystemException: The transaction has been
rolled back.  See the nested exceptions for details on the errors that
occurred.; nested exception is <openjpa-1.0.4-r420667:989711 fatal general
error> org.apache.openjpa.persistence.PersistenceException: The transaction
has been rolled back.  See the nested exceptions for details on the errors
that occurred.

...

Caused by: <openjpa-1.0.4-r420667:989711 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: ORA-01400: cannot
insert NULL into ("FRM"."JOBDEF"."ID")
 {prepstmnt 9592423 INSERT INTO JOBDEF (ACTIVE, CLASSNAME, JOBNAME,
JOBPARAMS) VALUES (?, ?, ?, ?) [params=?, ?, ?, ?]} [code=1400, state=23000]

So, for some reason, the ID is not created. I'm looking around but can't
find a solution.

Here is the entity with the ID

@Entity
@Table(name = "JOBDEF")
public class SequenceIdJobDefinitionImpl extends JobDefinitionBaseImpl {

        /** The Constant serialVersionUID. */
        private static final long serialVersionUID = 7851794269407495684L;

        /** The id. */
        @Id
        @SequenceGenerator(name = "JOBDEF_SEQUENCE_GENERATOR", sequenceName =
"JOBDEF_SEQ")
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator =
"JOBDEF_SEQUENCE_GENERATOR")
        private Long id;

        /**
         * Gets the id.
         * 
         * @return the id
         * @see
com.ing.rcc.be.hbexport.taskmgr.data.model.impl.JobDefinitionBaseImpl
         *      #getId()
         */
        public Long getId() {
                return id;
        }

        /**
         * Sets the id.
         * 
         * @param id
         *            the new id
         */
        public void setId(Long id) {
                this.id = id;
        }
}

Any clues ?

many regards,

Rudi Welter
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/openjpa-1-0-4-primary-key-not-created-tp5587124p5587124.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to