Class JpaRoleEntity
- java.lang.Object
-
- org.keycloak.models.map.common.UpdatableEntity.Impl
-
- org.keycloak.models.map.role.MapRoleEntity.AbstractRoleEntity
-
- org.keycloak.models.map.storage.jpa.role.entity.JpaRoleEntity
-
- All Implemented Interfaces:
Serializable,AbstractEntity,EntityWithAttributes,UpdatableEntity,MapRoleEntity,JpaRootEntity,JpaRootVersionedEntity
@Entity public class JpaRoleEntity extends MapRoleEntity.AbstractRoleEntity implements JpaRootVersionedEntity
There are some fields marked by@Column(insertable = false, updatable = false). Those fields are automatically generated by database from json field, therefore marked as non-insertable and non-updatable to instruct hibernate.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.role.MapRoleEntity
MapRoleEntity.AbstractRoleEntity
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.common.UpdatableEntity
UpdatableEntity.Impl
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
updated
-
-
Constructor Summary
Constructors Constructor Description JpaRoleEntity()No-argument constructor, used by hibernate to instantiate entities.JpaRoleEntity(UUID id, int version, Integer entityVersion, String realmId, String clientId, String name, String description)Used by hibernate when calling cb.construct from read(QueryParameters) method.JpaRoleEntity(DeepCloner cloner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompositeRole(String roleId)booleanequals(Object obj)List<String>getAttribute(String name)Map<String,List<String>>getAttributes()StringgetClientId()Set<String>getCompositeRoles()IntegergetCurrentSchemaVersion()StringgetDescription()IntegergetEntityVersion()StringgetId()StringgetName()StringgetRealmId()intgetVersion()Version of the JPA entity used for optimistic lockinginthashCode()booleanisMetadataInitialized()voidremoveAttribute(String name)voidremoveCompositeRole(String roleId)voidsetAttribute(String name, List<String> values)voidsetAttributes(Map<String,List<String>> attributes)voidsetClientId(String clientId)voidsetCompositeRoles(Set<String> compositeRoles)voidsetDescription(String description)voidsetEntityVersion(Integer entityVersion)voidsetId(String id)voidsetName(String name)voidsetRealmId(String realmId)-
Methods inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
clearUpdatedFlag, isUpdated
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.jpa.JpaRootEntity
updateEntityVersion
-
Methods inherited from interface org.keycloak.models.map.common.UpdatableEntity
clearUpdatedFlag, isUpdated
-
-
-
-
Constructor Detail
-
JpaRoleEntity
public JpaRoleEntity()
No-argument constructor, used by hibernate to instantiate entities.
-
JpaRoleEntity
public JpaRoleEntity(DeepCloner cloner)
-
-
Method Detail
-
isMetadataInitialized
public boolean isMetadataInitialized()
-
getCurrentSchemaVersion
public Integer getCurrentSchemaVersion()
- Specified by:
getCurrentSchemaVersionin interfaceJpaRootEntity
-
getEntityVersion
public Integer getEntityVersion()
- Specified by:
getEntityVersionin interfaceJpaRootEntity- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
public void setEntityVersion(Integer entityVersion)
- Specified by:
setEntityVersionin interfaceJpaRootEntity- Parameters:
entityVersion- sets current supported version to JPA entity.
-
getVersion
public int getVersion()
Description copied from interface:JpaRootVersionedEntityVersion of the JPA entity used for optimistic locking- Specified by:
getVersionin interfaceJpaRootVersionedEntity
-
getId
public String getId()
- Specified by:
getIdin interfaceAbstractEntity- Overrides:
getIdin classMapRoleEntity.AbstractRoleEntity
-
setId
public void setId(String id)
- Specified by:
setIdin interfaceAbstractEntity- Overrides:
setIdin classMapRoleEntity.AbstractRoleEntity
-
getRealmId
public String getRealmId()
- Specified by:
getRealmIdin interfaceMapRoleEntity
-
getClientId
public String getClientId()
- Specified by:
getClientIdin interfaceMapRoleEntity
-
getName
public String getName()
- Specified by:
getNamein interfaceMapRoleEntity
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceMapRoleEntity
-
setRealmId
public void setRealmId(String realmId)
- Specified by:
setRealmIdin interfaceMapRoleEntity
-
setClientId
public void setClientId(String clientId)
- Specified by:
setClientIdin interfaceMapRoleEntity
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceMapRoleEntity
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfaceMapRoleEntity
-
getCompositeRoles
public Set<String> getCompositeRoles()
- Specified by:
getCompositeRolesin interfaceMapRoleEntity
-
setCompositeRoles
public void setCompositeRoles(Set<String> compositeRoles)
- Specified by:
setCompositeRolesin interfaceMapRoleEntity
-
addCompositeRole
public void addCompositeRole(String roleId)
- Specified by:
addCompositeRolein interfaceMapRoleEntity
-
removeCompositeRole
public void removeCompositeRole(String roleId)
- Specified by:
removeCompositeRolein interfaceMapRoleEntity
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributesin interfaceEntityWithAttributes
-
getAttribute
public List<String> getAttribute(String name)
- Specified by:
getAttributein interfaceEntityWithAttributes
-
setAttributes
public void setAttributes(Map<String,List<String>> attributes)
- Specified by:
setAttributesin interfaceEntityWithAttributes
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttributein interfaceEntityWithAttributes
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceEntityWithAttributes
-
-