Skip to main content

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

I do not get this issue.  Could you include the full exception stack trace.

Ensure you are using EclipseLink 2.0, and JPA 2.0.


lb.alvaro wrote:
> 
> 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
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Run-time-exception-with-EclipseLink-JPA-2.0-Employee-example-tp27730175p27748194.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top