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 aUser
.- Author:
- Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JpaUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
org.modelmapper.ModelMapper
fromMe()
Set<String>
getApplicationIds()
Map<String,Object>
getAttributes()
Class<?>
getBusinessDomainType()
String
getCustomerContextId()
String
getEmail()
String
getExternalId()
String
getFirstName()
String
getFullName()
String
getId()
String
getLastName()
Instant
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).Instant
getLockedTime()
String
getMiddleName()
String
getPassword()
Set<JpaUserPermission>
getPermissions()
String
getPlainPassword()
Set<JpaUserRestrictedPermission>
getRestrictedPermissions()
Set<JpaUserRestrictedRole>
getRestrictedRoles()
Set<JpaUserRestriction>
getRestrictions()
Set<JpaUserRole>
getRoles()
String
getServerId()
String
getServiceId()
String
getTenantId()
String
getType()
String
getUsername()
int
hashCode()
boolean
isActive()
boolean
isApplicationAccess()
boolean
isArchived()
boolean
isChangePasswordRequired()
boolean
isExpired()
boolean
isImpersonationAllowed()
boolean
isLocked()
boolean
isTenantAccess()
protected User
pruneArchivedReferences(org.modelmapper.spi.MappingContext<JpaUser,User> mappingContext)
Used as theTypeMap.setPostConverter(Converter)
forfromMe()
.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
setEmail(String email)
void
setExpired(boolean expired)
void
setExternalId(String externalId)
void
setFirstName(String firstName)
void
setFullName(String fullName)
void
setId(String id)
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
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
setType(String type)
void
setUsername(String username)
org.modelmapper.ModelMapper
toMe()
protected <U extends User,J extends JpaUser>
JtoMeParentUserBackReferenceAdder(org.modelmapper.spi.MappingContext<U,J> mappingContext)
String
toString()
-
-
-
Method Detail
-
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
public Class<?> getBusinessDomainType()
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getId
public String getId()
-
getFirstName
public String getFirstName()
- See Also:
User.firstName
-
getMiddleName
public String getMiddleName()
- See Also:
User.middleName
-
getLastName
public String getLastName()
- See Also:
User.lastName
-
getFullName
public String getFullName()
- See Also:
User.fullName
-
getUsername
public String getUsername()
- See Also:
User.username
-
getPassword
public String getPassword()
- See Also:
User.password
-
getPlainPassword
public String getPlainPassword()
-
getEmail
public String getEmail()
- See Also:
User.email
-
isActive
public boolean isActive()
- See Also:
User.active
-
isChangePasswordRequired
public boolean isChangePasswordRequired()
- See Also:
User.changePasswordRequired
-
isLocked
public boolean isLocked()
- See Also:
User.locked
-
isExpired
public boolean isExpired()
- See Also:
User.expired
-
isImpersonationAllowed
public boolean isImpersonationAllowed()
- See Also:
User.impersonationAllowed
-
getServiceId
public String getServiceId()
- See Also:
User.serviceId
-
getExternalId
public String getExternalId()
- See Also:
User.externalId
-
isTenantAccess
public boolean isTenantAccess()
- See Also:
User.tenantAccess
-
isApplicationAccess
public boolean isApplicationAccess()
- See Also:
User.applicationAccess
-
getTenantId
public String getTenantId()
- See Also:
User.tenantId
-
getApplicationIds
public Set<String> getApplicationIds()
- See Also:
User.applicationIds
-
getCustomerContextId
public String getCustomerContextId()
- See Also:
User.customerContextId
-
getAttributes
public Map<String,Object> getAttributes()
- See Also:
User.attributes
-
getRoles
public Set<JpaUserRole> getRoles()
- See Also:
User.roles
-
getPermissions
public Set<JpaUserPermission> getPermissions()
- See Also:
User.permissions
-
getRestrictions
public Set<JpaUserRestriction> getRestrictions()
- See Also:
User.restrictions
-
getRestrictedRoles
public Set<JpaUserRestrictedRole> getRestrictedRoles()
- See Also:
User.restrictedRoles
-
getRestrictedPermissions
public Set<JpaUserRestrictedPermission> getRestrictedPermissions()
- See Also:
User.restrictedPermissions
-
getServerId
public String getServerId()
- See Also:
User.serverId
-
getLastUpdated
public Instant 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:
User.lastUpdated
-
isArchived
public boolean isArchived()
- See Also:
User.archived
-
getLockedTime
public Instant getLockedTime()
-
setId
public void setId(String id)
-
setFirstName
public void setFirstName(String firstName)
- See Also:
User.firstName
-
setMiddleName
public void setMiddleName(String middleName)
- See Also:
User.middleName
-
setLastName
public void setLastName(String lastName)
- See Also:
User.lastName
-
setFullName
public void setFullName(String fullName)
- See Also:
User.fullName
-
setUsername
public void setUsername(String username)
- See Also:
User.username
-
setPassword
public void setPassword(String password)
- See Also:
User.password
-
setPlainPassword
public void setPlainPassword(String plainPassword)
-
setEmail
public void setEmail(String email)
- See Also:
User.email
-
setActive
public void setActive(boolean active)
- See Also:
User.active
-
setChangePasswordRequired
public void setChangePasswordRequired(boolean changePasswordRequired)
- See Also:
User.changePasswordRequired
-
setLocked
public void setLocked(boolean locked)
- See Also:
User.locked
-
setExpired
public void setExpired(boolean expired)
- See Also:
User.expired
-
setImpersonationAllowed
public void setImpersonationAllowed(boolean impersonationAllowed)
- See Also:
User.impersonationAllowed
-
setServiceId
public void setServiceId(String serviceId)
- See Also:
User.serviceId
-
setExternalId
public void setExternalId(String externalId)
- See Also:
User.externalId
-
setTenantAccess
public void setTenantAccess(boolean tenantAccess)
- See Also:
User.tenantAccess
-
setApplicationAccess
public void setApplicationAccess(boolean applicationAccess)
- See Also:
User.applicationAccess
-
setTenantId
public void setTenantId(String tenantId)
- See Also:
User.tenantId
-
setApplicationIds
public void setApplicationIds(Set<String> applicationIds)
- See Also:
User.applicationIds
-
setCustomerContextId
public void setCustomerContextId(String customerContextId)
- See Also:
User.customerContextId
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
- See Also:
User.attributes
-
setRoles
public void setRoles(Set<JpaUserRole> roles)
- See Also:
User.roles
-
setPermissions
public void setPermissions(Set<JpaUserPermission> permissions)
- See Also:
User.permissions
-
setRestrictions
public void setRestrictions(Set<JpaUserRestriction> restrictions)
- See Also:
User.restrictions
-
setRestrictedRoles
public void setRestrictedRoles(Set<JpaUserRestrictedRole> restrictedRoles)
- See Also:
User.restrictedRoles
-
setRestrictedPermissions
public void setRestrictedPermissions(Set<JpaUserRestrictedPermission> restrictedPermissions)
- See Also:
User.restrictedPermissions
-
setServerId
public void setServerId(String serverId)
- See Also:
User.serverId
-
setLastUpdated
public 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).- See Also:
User.lastUpdated
-
setArchived
public void setArchived(boolean archived)
- See Also:
User.archived
-
setLockedTime
public void setLockedTime(Instant lockedTime)
-
canEqual
protected boolean canEqual(Object other)
-
-