Class JpaComponentEntity
java.lang.Object
org.keycloak.models.map.common.UpdatableEntity.Impl
org.keycloak.models.map.storage.jpa.realm.entity.JpaComponentEntity
- All Implemented Interfaces:
Serializable
,AbstractEntity
,UpdatableEntity
,MapComponentEntity
,JpaChildEntity<JpaRealmEntity>
,JpaRootEntity
,JpaRootVersionedEntity
@Entity
public class JpaComponentEntity
extends UpdatableEntity.Impl
implements MapComponentEntity, JpaRootVersionedEntity, JpaChildEntity<JpaRealmEntity>
JPA
MapComponentEntity
implementation. Some fields are annotated with @Column(insertable = false, updatable = false)
to indicate that they are automatically generated from json fields. As such, these fields are non-insertable and non-updatable.
Components are independent (i.e. a component doesn't depend on another component) and can be manipulated directly via
the component endpoints.
By implementing JpaRootVersionedEntity
, this entity will enforce optimistic locking, which can lead to
OptimisticLockException
if more than one thread attempts to modify the same component
at the same time.- Author:
- Stefan Guilhen
- See Also:
-
Nested Class Summary
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.JpaComponentEntity
(DeepCloner cloner) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getId()
getName()
Parent entity that should get its optimistic locking version updated upon changes in the childint
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
void
void
setEntityVersion
(Integer version) void
void
void
setParent
(JpaRealmEntity root) void
setParentId
(String parentId) void
setProviderId
(String providerId) void
setProviderType
(String providerType) void
setSubType
(String subType) 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
-
JpaComponentEntity
public JpaComponentEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaComponentEntity
-
-
Method Details
-
getParent
Description copied from interface:JpaChildEntity
Parent entity that should get its optimistic locking version updated upon changes in the child- Specified by:
getParent
in interfaceJpaChildEntity<JpaRealmEntity>
-
setParent
-
isMetadataInitialized
public boolean isMetadataInitialized() -
getId
- Specified by:
getId
in interfaceAbstractEntity
-
setId
- Specified by:
setId
in interfaceAbstractEntity
-
getEntityVersion
- Specified by:
getEntityVersion
in interfaceJpaRootEntity
- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
- Specified by:
setEntityVersion
in interfaceJpaRootEntity
- Parameters:
version
- 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
-
getCurrentSchemaVersion
- Specified by:
getCurrentSchemaVersion
in interfaceJpaRootEntity
-
getName
- Specified by:
getName
in interfaceMapComponentEntity
-
setName
- Specified by:
setName
in interfaceMapComponentEntity
-
getProviderId
- Specified by:
getProviderId
in interfaceMapComponentEntity
-
setProviderId
- Specified by:
setProviderId
in interfaceMapComponentEntity
-
getProviderType
- Specified by:
getProviderType
in interfaceMapComponentEntity
-
setProviderType
- Specified by:
setProviderType
in interfaceMapComponentEntity
-
getSubType
- Specified by:
getSubType
in interfaceMapComponentEntity
-
setSubType
- Specified by:
setSubType
in interfaceMapComponentEntity
-
getParentId
- Specified by:
getParentId
in interfaceMapComponentEntity
-
setParentId
- Specified by:
setParentId
in interfaceMapComponentEntity
-
getConfig
- Specified by:
getConfig
in interfaceMapComponentEntity
-
setConfig
- Specified by:
setConfig
in interfaceMapComponentEntity
-
hashCode
public int hashCode() -
equals
-