Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android forum!
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. :-)
 
jQuery in Action, 2nd edition
 
subject: JPA merging not all entities
 
Similar Threads
Ajax behavior/ Conditional rendering
onchange="submit()" immediate="true" does not work
integrate upload file with form
Run the MethodeBean & display the fields that corresponds to selectMenu
Exception during addition of data from UI