aspose file tools*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA merging not all entities" Watch "JPA merging not all entities" New topic
Author

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
Call: UPDATE LOCALUSER SET LASTNAME = ?, PASSWORD = ? WHERE (EMAIL = ?)
bind => [3 parameters bound]


This is the JSF:


and this is the EJB:




Is it possible to update only few entities?

Thanks
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: http://aspose.com/file-tools
 
subject: JPA merging not all entities