Class JpaUserRole
java.lang.Object
com.broadleafcommerce.auth.security.domain.JpaUserRole
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable,com.broadleafcommerce.translation.domain.Translatable,Serializable
@Entity
public class JpaUserRole
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.translation.domain.Translatable
- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanorg.modelmapper.ModelMapperfromMe()Class<?>getId()We don't useLastModifiedDatehere because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).getName()A soft reference to the parent of this role.inthashCode()booleanbooleanprotected UserRolepruneArchivedReferences(org.modelmapper.spi.MappingContext<JpaUserRole, UserRole> mappingContext) Used as theTypeMap.setPostConverter(Converter)forfromMe().voidsetAccountRole(boolean accountRole) voidsetArchived(boolean archived) voidsetDescription(String description) voidsetFriendlyName(String friendlyName) voidvoidsetLastUpdated(Instant lastUpdated) We don't useLastModifiedDatehere because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).voidvoidsetParentRoleId(String parentRoleId) A soft reference to the parent of this role.voidsetPermissions(Set<JpaUserPermission> permissions) org.modelmapper.ModelMappertoMe()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMe
-
Constructor Details
-
JpaUserRole
public JpaUserRole()
-
-
Method Details
-
fromMe
public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
pruneArchivedReferences
protected UserRole pruneArchivedReferences(org.modelmapper.spi.MappingContext<JpaUserRole, UserRole> mappingContext) Used as theTypeMap.setPostConverter(Converter)forfromMe().JPA will eagerly fetch
permissionsif 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:
toMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getBusinessDomainType
- Specified by:
getBusinessDomainTypein interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getContextId
- Specified by:
getContextIdin interfacecom.broadleafcommerce.translation.domain.Translatable
-
getId
-
getName
-
getPermissions
-
getParentRoleId
A soft reference to the parent of this role.- See Also:
-
UserRole.parentRoleId
-
getLastUpdated
We don't useLastModifiedDatehere because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).- See Also:
-
UserRole.lastUpdated
-
isArchived
public boolean isArchived()- See Also:
-
UserRole.archived
-
isAccountRole
public boolean isAccountRole() -
getFriendlyName
-
getDescription
-
setId
-
setName
-
setPermissions
-
setParentRoleId
A soft reference to the parent of this role.- See Also:
-
UserRole.parentRoleId
-
setLastUpdated
We don't useLastModifiedDatehere because we want to enable manually setting this value (ex: for setting the lastUpdated to a value received in a persistence message).- See Also:
-
UserRole.lastUpdated
-
setArchived
public void setArchived(boolean archived) - See Also:
-
UserRole.archived
-
setAccountRole
public void setAccountRole(boolean accountRole) -
setFriendlyName
-
setDescription
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-