Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Run-time exception with EclipseLink JPA 2.0 Employee example

I'm trying to run the EclipseLink JPA 2.0 Employee example:
  http://wiki.eclipse.org/EclipseLink/Examples/JPA/2.0/Employee

I created a NetBeans project and configured persistence.xml to use Apache Derby.  It compiles fine, but when I run the Populate program, I get the following run-time exception:

Exception in thread "main" javax.persistence.RollbackException: Exception [EclipseLink-7251] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The attribute [type] of class [model.PhoneNumber] is mapped to a primary key column in the database. Updates are not allowed.
        at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
        at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
        at example.Populate.populate(Populate.java:40)
        at example.Populate.main(Populate.java:32)


Any suggestions on how to get this example project to run correctly?

On a related note, NetBeans reports warning at line 70 of Employee.java:  
The attribute column name (PERIOD) is a reserved SQL:1999 keyword

Thanks in advance for any responses.
Alvaro

Back to the top