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 void
addCompositeRole(String roleId)
boolean
equals(Object obj)
List<String>
getAttribute(String name)
Map<String,List<String>>
getAttributes()
String
getClientId()
Set<String>
getCompositeRoles()
Integer
getCurrentSchemaVersion()
String
getDescription()
Integer
getEntityVersion()
String
getId()
String
getName()
String
getRealmId()
int
getVersion()
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
isMetadataInitialized()
void
removeAttribute(String name)
void
removeCompositeRole(String roleId)
void
setAttribute(String name, List<String> values)
void
setAttributes(Map<String,List<String>> attributes)
void
setClientId(String clientId)
void
setCompositeRoles(Set<String> compositeRoles)
void
setDescription(String description)
void
setEntityVersion(Integer entityVersion)
void
setId(String id)
void
setName(String name)
void
setRealmId(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:
getCurrentSchemaVersion
in interfaceJpaRootEntity
-
getEntityVersion
public Integer getEntityVersion()
- Specified by:
getEntityVersion
in interfaceJpaRootEntity
- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
public void setEntityVersion(Integer entityVersion)
- Specified by:
setEntityVersion
in interfaceJpaRootEntity
- Parameters:
entityVersion
- sets current supported version to JPA entity.
-
getVersion
public int getVersion()
Description copied from interface:JpaRootVersionedEntity
Version of the JPA entity used for optimistic locking- Specified by:
getVersion
in interfaceJpaRootVersionedEntity
-
getId
public String getId()
- Specified by:
getId
in interfaceAbstractEntity
- Overrides:
getId
in classMapRoleEntity.AbstractRoleEntity
-
setId
public void setId(String id)
- Specified by:
setId
in interfaceAbstractEntity
- Overrides:
setId
in classMapRoleEntity.AbstractRoleEntity
-
getRealmId
public String getRealmId()
- Specified by:
getRealmId
in interfaceMapRoleEntity
-
getClientId
public String getClientId()
- Specified by:
getClientId
in interfaceMapRoleEntity
-
getName
public String getName()
- Specified by:
getName
in interfaceMapRoleEntity
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceMapRoleEntity
-
setRealmId
public void setRealmId(String realmId)
- Specified by:
setRealmId
in interfaceMapRoleEntity
-
setClientId
public void setClientId(String clientId)
- Specified by:
setClientId
in interfaceMapRoleEntity
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceMapRoleEntity
-
setDescription
public void setDescription(String description)
- Specified by:
setDescription
in interfaceMapRoleEntity
-
getCompositeRoles
public Set<String> getCompositeRoles()
- Specified by:
getCompositeRoles
in interfaceMapRoleEntity
-
setCompositeRoles
public void setCompositeRoles(Set<String> compositeRoles)
- Specified by:
setCompositeRoles
in interfaceMapRoleEntity
-
addCompositeRole
public void addCompositeRole(String roleId)
- Specified by:
addCompositeRole
in interfaceMapRoleEntity
-
removeCompositeRole
public void removeCompositeRole(String roleId)
- Specified by:
removeCompositeRole
in interfaceMapRoleEntity
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributes
in interfaceEntityWithAttributes
-
getAttribute
public List<String> getAttribute(String name)
- Specified by:
getAttribute
in interfaceEntityWithAttributes
-
setAttributes
public void setAttributes(Map<String,List<String>> attributes)
- Specified by:
setAttributes
in interfaceEntityWithAttributes
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttribute
in interfaceEntityWithAttributes
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttribute
in interfaceEntityWithAttributes
-
-