Class JpaUser
java.lang.Object
com.broadleafcommerce.auth.user.provider.jpa.domain.JpaUser
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
,Serializable
@Entity
public class JpaUser
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
Persisted counterpart for a
User
.- Author:
- Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
org.modelmapper.ModelMapper
fromMe()
Class<?>
getEmail()
getId()
We don't useLastModifiedDate
here because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).getRoles()
getType()
int
hashCode()
boolean
isActive()
boolean
boolean
boolean
boolean
boolean
boolean
isLocked()
boolean
protected User
pruneArchivedReferences
(org.modelmapper.spi.MappingContext<JpaUser, User> mappingContext) Used as theTypeMap.setPostConverter(Converter)
forfromMe()
.void
setAccountRoles
(List<JpaAccountRoleXref> accountRoles) void
setActive
(boolean active) void
setApplicationAccess
(boolean applicationAccess) void
setApplicationIds
(Set<String> applicationIds) void
setArchived
(boolean archived) void
setAttributes
(Map<String, Object> attributes) void
setChangePasswordRequired
(boolean changePasswordRequired) void
setCustomerContextId
(String customerContextId) void
setDefaultAccountId
(String defaultAccountId) void
void
setExpired
(boolean expired) void
setExternalId
(String externalId) void
setFirstName
(String firstName) void
setFullName
(String fullName) void
void
setImpersonationAllowed
(boolean impersonationAllowed) void
setLastName
(String lastName) void
setLastUpdated
(Instant lastUpdated) We don't useLastModifiedDate
here because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).void
setLocked
(boolean locked) void
setLockedTime
(Instant lockedTime) void
setMiddleName
(String middleName) void
setPassword
(String password) void
setPasswordHistory
(List<JpaUserHistoricalPassword> passwordHistory) void
setPasswordLastUpdated
(Instant passwordLastUpdated) void
setPermissions
(Set<JpaUserPermission> permissions) void
setPlainPassword
(String plainPassword) void
setRestrictedPermissions
(Set<JpaUserRestrictedPermission> restrictedPermissions) void
setRestrictedRoles
(Set<JpaUserRestrictedRole> restrictedRoles) void
setRestrictions
(Set<JpaUserRestriction> restrictions) void
setRoles
(Set<JpaUserRole> roles) void
setServerId
(String serverId) void
setServiceId
(String serviceId) void
setTenantAccess
(boolean tenantAccess) void
setTenantId
(String tenantId) void
void
setUsername
(String username) org.modelmapper.ModelMapper
toMe()
toMeParentUserBackReferenceAdder
(org.modelmapper.spi.MappingContext<U, J> mappingContext) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMe
-
Constructor Details
-
JpaUser
public JpaUser()
-
-
Method Details
-
fromMe
public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
pruneArchivedReferences
protected User pruneArchivedReferences(org.modelmapper.spi.MappingContext<JpaUser, User> mappingContext) Used as theTypeMap.setPostConverter(Converter)
forfromMe()
.JPA will eagerly fetch
roles
andpermissions
if they exist in the data store, but we have a soft-deletion concept that JPA does not account for. This ensures that any references to entities that have been archived are pruned before being mapped to the business domain. This protects against those entities being usable despite being archived.- Parameters:
mappingContext
- the model mapper mapping context- Returns:
- the business-domain user after removing any references to archived records
-
toMe
public org.modelmapper.ModelMapper toMe()- Specified by:
toMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMeParentUserBackReferenceAdder
protected <U extends User,J extends JpaUser> J toMeParentUserBackReferenceAdder(org.modelmapper.spi.MappingContext<U, J> mappingContext) Used as theTypeMap.setPostConverter(Converter)
forJpaUser
intoMe()
.For each of the parent-user back-references in managed collections like
getRestrictions()
,getRestrictedRoles()
, andgetRestrictedPermissions()
, explicitly sets their value to the user instance being mapped.As documented in
TypeMap.include(Class, Class)
, extensions will not automatically inherit this converter, and must manually set it on the extended type map.- Parameters:
mappingContext
- the model mapper mapping context- Returns:
- the persisted-domain user after setting each of its managed collection items' parent references to itself
-
getBusinessDomainType
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getId
-
getFirstName
- See Also:
-
getMiddleName
- See Also:
-
getLastName
- See Also:
-
getFullName
- See Also:
-
getUsername
- See Also:
-
getPassword
- See Also:
-
getPasswordLastUpdated
- See Also:
-
getPasswordHistory
- See Also:
-
getPlainPassword
-
getEmail
- See Also:
-
isActive
public boolean isActive()- See Also:
-
isChangePasswordRequired
public boolean isChangePasswordRequired()- See Also:
-
isLocked
public boolean isLocked()- See Also:
-
isExpired
public boolean isExpired()- See Also:
-
isImpersonationAllowed
public boolean isImpersonationAllowed()- See Also:
-
getServiceId
- See Also:
-
getType
- See Also:
-
getExternalId
- See Also:
-
isTenantAccess
public boolean isTenantAccess()- See Also:
-
isApplicationAccess
public boolean isApplicationAccess()- See Also:
-
getTenantId
- See Also:
-
getApplicationIds
- See Also:
-
getCustomerContextId
- See Also:
-
getAttributes
- See Also:
-
getRoles
- See Also:
-
getPermissions
- See Also:
-
getRestrictions
- See Also:
-
getRestrictedRoles
- See Also:
-
getRestrictedPermissions
- See Also:
-
getServerId
- See Also:
-
getLastUpdated
We don't useLastModifiedDate
here because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).- See Also:
-
isArchived
public boolean isArchived()- See Also:
-
getLockedTime
- See Also:
-
getAccountRoles
- See Also:
-
getDefaultAccountId
-
setId
-
setFirstName
- See Also:
-
setMiddleName
- See Also:
-
setLastName
- See Also:
-
setFullName
- See Also:
-
setUsername
- See Also:
-
setPassword
- See Also:
-
setPasswordLastUpdated
- See Also:
-
setPasswordHistory
- See Also:
-
setPlainPassword
-
setEmail
- See Also:
-
setActive
public void setActive(boolean active) - See Also:
-
setChangePasswordRequired
public void setChangePasswordRequired(boolean changePasswordRequired) - See Also:
-
setLocked
public void setLocked(boolean locked) - See Also:
-
setExpired
public void setExpired(boolean expired) - See Also:
-
setImpersonationAllowed
public void setImpersonationAllowed(boolean impersonationAllowed) - See Also:
-
setServiceId
- See Also:
-
setType
- See Also:
-
setExternalId
- See Also:
-
setTenantAccess
public void setTenantAccess(boolean tenantAccess) - See Also:
-
setApplicationAccess
public void setApplicationAccess(boolean applicationAccess) - See Also:
-
setTenantId
- See Also:
-
setApplicationIds
- See Also:
-
setCustomerContextId
- See Also:
-
setAttributes
- See Also:
-
setRoles
- See Also:
-
setPermissions
- See Also:
-
setRestrictions
- See Also:
-
setRestrictedRoles
- See Also:
-
setRestrictedPermissions
- See Also:
-
setServerId
- See Also:
-
setLastUpdated
We don't useLastModifiedDate
here because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).- See Also:
-
setArchived
public void setArchived(boolean archived) - See Also:
-
setLockedTime
- See Also:
-
setAccountRoles
- See Also:
-
setDefaultAccountId
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-