Class JpaGroupEntity
java.lang.Object
org.keycloak.models.map.common.UpdatableEntity.Impl
org.keycloak.models.map.group.MapGroupEntity.AbstractGroupEntity
org.keycloak.models.map.storage.jpa.group.entity.JpaGroupEntity
- All Implemented Interfaces:
Serializable
,AbstractEntity
,EntityWithAttributes
,UpdatableEntity
,MapGroupEntity
,JpaRootEntity
,JpaRootVersionedEntity
@Entity
public class JpaGroupEntity
extends MapGroupEntity.AbstractGroupEntity
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.group.MapGroupEntity
MapGroupEntity.AbstractGroupEntity
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
ConstructorDescriptionNo-argument constructor, used by hibernate to instantiate entities.JpaGroupEntity
(UUID id, int version, Integer entityVersion, String realmId, String name, String parentId) Used by hibernate when calling cb.construct from read(QueryParameters) method.JpaGroupEntity
(DeepCloner cloner) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGrantedRole
(String role) boolean
getAttribute
(String name) getId()
getName()
int
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
void
removeAttribute
(String name) void
removeGrantedRole
(String role) void
setAttribute
(String name, List<String> values) void
setAttributes
(Map<String, List<String>> attributes) void
setEntityVersion
(Integer entityVersion) void
setGrantedRoles
(Set<String> grantedRoles) void
void
void
setParentId
(String parentId) void
setRealmId
(String realmId) Methods inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
clearUpdatedFlag, isUpdated, markUpdatedFlag
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, markUpdatedFlag
-
Constructor Details
-
JpaGroupEntity
public JpaGroupEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaGroupEntity
-
JpaGroupEntity
public JpaGroupEntity(UUID id, int version, Integer entityVersion, String realmId, String name, String parentId) Used by hibernate when calling cb.construct from read(QueryParameters) method. It is used to select group without metadata(json) field.
-
-
Method Details
-
isMetadataInitialized
public boolean isMetadataInitialized() -
getEntityVersion
- Specified by:
getEntityVersion
in interfaceJpaRootEntity
- Returns:
- current supported version of the JPA entity used for schema versioning.
-
getCurrentSchemaVersion
- Specified by:
getCurrentSchemaVersion
in interfaceJpaRootEntity
-
setEntityVersion
- 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
- Specified by:
getId
in interfaceAbstractEntity
- Overrides:
getId
in classMapGroupEntity.AbstractGroupEntity
-
setId
- Specified by:
setId
in interfaceAbstractEntity
- Overrides:
setId
in classMapGroupEntity.AbstractGroupEntity
-
getRealmId
- Specified by:
getRealmId
in interfaceMapGroupEntity
-
setRealmId
- Specified by:
setRealmId
in interfaceMapGroupEntity
-
getName
- Specified by:
getName
in interfaceMapGroupEntity
-
setName
- Specified by:
setName
in interfaceMapGroupEntity
-
setParentId
- Specified by:
setParentId
in interfaceMapGroupEntity
-
getParentId
- Specified by:
getParentId
in interfaceMapGroupEntity
-
getGrantedRoles
- Specified by:
getGrantedRoles
in interfaceMapGroupEntity
-
setGrantedRoles
- Specified by:
setGrantedRoles
in interfaceMapGroupEntity
-
addGrantedRole
- Specified by:
addGrantedRole
in interfaceMapGroupEntity
-
removeGrantedRole
- Specified by:
removeGrantedRole
in interfaceMapGroupEntity
-
getAttributes
- Specified by:
getAttributes
in interfaceEntityWithAttributes
-
setAttributes
- Specified by:
setAttributes
in interfaceEntityWithAttributes
-
getAttribute
- Specified by:
getAttribute
in interfaceEntityWithAttributes
-
setAttribute
- Specified by:
setAttribute
in interfaceEntityWithAttributes
-
removeAttribute
- Specified by:
removeAttribute
in interfaceEntityWithAttributes
-
hashCode
public int hashCode() -
equals
-