public class UserFormTransformer<U extends IGenericEcomUser,UA extends UserAttribute> extends UserFormTransformer<U,UA>
Transformer
that takes in a MapUser
or UserAttribute
instance.Map
with the entities replaced by the merged or transformed versions.
Transformer
does not perform validation. One can put a MapTransformer
that validates every entity before this one is called.
UserFormTransformer.getSessionUser(HttpServletRequest)
if you want to use this in a non Wicket environment.
uses IGenericEcomUser.getUserId()
instead of User.getId()
to identify userUserFormTransformer
UserFormTransformer.UserIdSetter
mergeWithCurrentSessionUser, userAttributesDao, userDao
Constructor and Description |
---|
UserFormTransformer() |
Modifier and Type | Method and Description |
---|---|
protected U |
saveUser(U userObject,
U userSessionObject)
Identify if the entity is a fresh independent entity or an update of an existing one.
Persist accordingly |
protected UA |
saveUserAttribute(UA userAttribObject,
U userSessionObject)
The resultant object is a merged object to ensure an update can be performed if the userSessioObject is valid and related to this user
Persist accordingly |
protected void |
updateExisting(UA userAttribObject,
U userSessionObject)
To ensure if the attribute being saved is updated, we need to check for existing attribute for the userSessionObject
and accordingly set it up to be updated or keep it an insert operation.
|
getServletRequestContextAccessor, getSessionUser, getUserAttributesDao, getUserDao, isMergeWithCurrentSessionUser, merge, setMergeWithCurrentSessionUser, setServletRequestContextAccessor, setUserAttributesDao, setUserDao, transform, validate, validate
@Transactional(readOnly=false) protected U saveUser(U userObject, U userSessionObject)
UserFormTransformer
saveUser
in class UserFormTransformer<U extends IGenericEcomUser,UA extends UserAttribute>
userObject
- as UuserSessionObject
- as Userprotected void updateExisting(UA userAttribObject, U userSessionObject)
UserFormTransformer
updateExisting
in class UserFormTransformer<U extends IGenericEcomUser,UA extends UserAttribute>
userAttribObject
- as UAuserSessionObject
- as U@Transactional(readOnly=false) protected UA saveUserAttribute(UA userAttribObject, U userSessionObject)
UserFormTransformer
saveUserAttribute
in class UserFormTransformer<U extends IGenericEcomUser,UA extends UserAttribute>
userSessionObject
- as UserCopyright © 2018. All rights reserved.