File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes JPA merging not all entities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA merging not all entities" Watch "JPA merging not all entities" New topic

JPA merging not all entities

Enrico Morelli
Ranch Hand

Joined: Jan 07, 2013
Posts: 30
Dear all,

I don't understand the merge use. I've a USER table with firstname, lastname, email and password entities. So I want to create different JSF pages to modify separately password and the other data.
But I cannot, because when I try to submit the JSF form with user data modification I receive the error:

Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: Column 'PASSWORD' cannot accept a NULL value.
Error Code: -1
bind => [3 parameters bound]

This is the JSF:

and this is the EJB:

Is it possible to update only few entities?

Enrico Morelli
Ranch Hand

Joined: Jan 07, 2013
Posts: 30
For the moment I solved in this mode.

For the password:

And for the other user data:

I don't know if it's correct, but works. :-)
I agree. Here's the link:
subject: JPA merging not all entities
It's not a secret anymore!