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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.map.role.MapRoleEntity
MapRoleEntity.AbstractRoleEntityNested 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
ConstructorsConstructorDescriptionNo-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
Modifier and TypeMethodDescriptionvoidaddCompositeRole(String roleId) booleangetAttribute(String name) getId()getName()intVersion of the JPA entity used for optimistic lockinginthashCode()booleanvoidremoveAttribute(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) voidvoidvoidsetRealmId(String realmId) Methods inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
clearUpdatedFlag, isUpdated, markUpdatedFlagMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.map.storage.jpa.JpaRootEntity
updateEntityVersionMethods inherited from interface org.keycloak.models.map.common.UpdatableEntity
clearUpdatedFlag, isUpdated, markUpdatedFlag
-
Constructor Details
-
JpaRoleEntity
public JpaRoleEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaRoleEntity
-
JpaRoleEntity
public 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. It is used to select role without metadata(json) field.
-
-
Method Details
-
isMetadataInitialized
public boolean isMetadataInitialized() -
getCurrentSchemaVersion
- Specified by:
getCurrentSchemaVersionin interfaceJpaRootEntity
-
getEntityVersion
- Specified by:
getEntityVersionin interfaceJpaRootEntity- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
- 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
- Specified by:
getIdin interfaceAbstractEntity- Overrides:
getIdin classMapRoleEntity.AbstractRoleEntity
-
setId
- Specified by:
setIdin interfaceAbstractEntity- Overrides:
setIdin classMapRoleEntity.AbstractRoleEntity
-
getRealmId
- Specified by:
getRealmIdin interfaceMapRoleEntity
-
getClientId
- Specified by:
getClientIdin interfaceMapRoleEntity
-
getName
- Specified by:
getNamein interfaceMapRoleEntity
-
getDescription
- Specified by:
getDescriptionin interfaceMapRoleEntity
-
setRealmId
- Specified by:
setRealmIdin interfaceMapRoleEntity
-
setClientId
- Specified by:
setClientIdin interfaceMapRoleEntity
-
setName
- Specified by:
setNamein interfaceMapRoleEntity
-
setDescription
- Specified by:
setDescriptionin interfaceMapRoleEntity
-
getCompositeRoles
- Specified by:
getCompositeRolesin interfaceMapRoleEntity
-
setCompositeRoles
- Specified by:
setCompositeRolesin interfaceMapRoleEntity
-
addCompositeRole
- Specified by:
addCompositeRolein interfaceMapRoleEntity
-
removeCompositeRole
- Specified by:
removeCompositeRolein interfaceMapRoleEntity
-
getAttributes
- Specified by:
getAttributesin interfaceEntityWithAttributes
-
getAttribute
- Specified by:
getAttributein interfaceEntityWithAttributes
-
setAttributes
- Specified by:
setAttributesin interfaceEntityWithAttributes
-
setAttribute
- Specified by:
setAttributein interfaceEntityWithAttributes
-
removeAttribute
- Specified by:
removeAttributein interfaceEntityWithAttributes
-
hashCode
public int hashCode() -
equals
-