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
ConstructorsConstructorDescriptionNo-argument constructor, used by hibernate to instantiate entities.JpaComponentEntity(DeepCloner cloner) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()getName()Parent entity that should get its optimistic locking version updated upon changes in the childintVersion of the JPA entity used for optimistic lockinginthashCode()booleanvoidvoidsetEntityVersion(Integer version) voidvoidvoidsetParent(JpaRealmEntity root) voidsetParentId(String parentId) voidsetProviderId(String providerId) voidsetProviderType(String providerType) voidsetSubType(String subType) 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
-
JpaComponentEntity
public JpaComponentEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaComponentEntity
-
-
Method Details
-
getParent
Description copied from interface:JpaChildEntityParent entity that should get its optimistic locking version updated upon changes in the child- Specified by:
getParentin interfaceJpaChildEntity<JpaRealmEntity>
-
setParent
-
isMetadataInitialized
public boolean isMetadataInitialized() -
getId
- Specified by:
getIdin interfaceAbstractEntity
-
setId
- Specified by:
setIdin interfaceAbstractEntity
-
getEntityVersion
- Specified by:
getEntityVersionin interfaceJpaRootEntity- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
- Specified by:
setEntityVersionin interfaceJpaRootEntity- Parameters:
version- 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
-
getCurrentSchemaVersion
- Specified by:
getCurrentSchemaVersionin interfaceJpaRootEntity
-
getName
- Specified by:
getNamein interfaceMapComponentEntity
-
setName
- Specified by:
setNamein interfaceMapComponentEntity
-
getProviderId
- Specified by:
getProviderIdin interfaceMapComponentEntity
-
setProviderId
- Specified by:
setProviderIdin interfaceMapComponentEntity
-
getProviderType
- Specified by:
getProviderTypein interfaceMapComponentEntity
-
setProviderType
- Specified by:
setProviderTypein interfaceMapComponentEntity
-
getSubType
- Specified by:
getSubTypein interfaceMapComponentEntity
-
setSubType
- Specified by:
setSubTypein interfaceMapComponentEntity
-
getParentId
- Specified by:
getParentIdin interfaceMapComponentEntity
-
setParentId
- Specified by:
setParentIdin interfaceMapComponentEntity
-
getConfig
- Specified by:
getConfigin interfaceMapComponentEntity
-
setConfig
- Specified by:
setConfigin interfaceMapComponentEntity
-
hashCode
public int hashCode() -
equals
-