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,Serializable
@Entity public class JpaUserRole extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
- Author:
- Nathan Moore (nathanmoore).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JpaUserRole()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)org.modelmapper.ModelMapperfromMe()Class<?>getBusinessDomainType()StringgetId()InstantgetLastUpdated()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).StringgetName()StringgetParentRoleId()A soft reference to the parent of this role.Set<JpaUserPermission>getPermissions()inthashCode()booleanisArchived()protected UserRolepruneArchivedReferences(org.modelmapper.spi.MappingContext<JpaUserRole,UserRole> mappingContext)Used as theTypeMap.setPostConverter(Converter)forfromMe().voidsetArchived(boolean archived)voidsetId(String id)voidsetLastUpdated(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).voidsetName(String name)voidsetParentRoleId(String parentRoleId)A soft reference to the parent of this role.voidsetPermissions(Set<JpaUserPermission> permissions)org.modelmapper.ModelMappertoMe()StringtoString()
-
-
-
Method Detail
-
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
public Class<?> getBusinessDomainType()
- Specified by:
getBusinessDomainTypein interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getId
public String getId()
-
getName
public String getName()
-
getPermissions
public Set<JpaUserPermission> getPermissions()
-
getParentRoleId
public String getParentRoleId()
A soft reference to the parent of this role.- See Also:
UserRole.parentRoleId
-
getLastUpdated
public Instant 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
-
setId
public void setId(String id)
-
setName
public void setName(String name)
-
setPermissions
public void setPermissions(Set<JpaUserPermission> permissions)
-
setParentRoleId
public void setParentRoleId(String parentRoleId)
A soft reference to the parent of this role.- See Also:
UserRole.parentRoleId
-
setLastUpdated
public void setLastUpdated(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).- See Also:
UserRole.lastUpdated
-
setArchived
public void setArchived(boolean archived)
- See Also:
UserRole.archived
-
canEqual
protected boolean canEqual(Object other)
-
-