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>
JPAMapComponentEntityimplementation. 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 implementingJpaRootVersionedEntity, this entity will enforce optimistic locking, which can lead toOptimisticLockExceptionif more than one thread attempts to modify the same component at the same time.- Author:
- Stefan Guilhen
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description JpaComponentEntity()No-argument constructor, used by hibernate to instantiate entities.JpaComponentEntity(DeepCloner cloner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Map<String,List<String>>getConfig()IntegergetCurrentSchemaVersion()IntegergetEntityVersion()StringgetId()StringgetName()JpaRealmEntitygetParent()Parent entity that should get its optimistic locking version updated upon changes in the childStringgetParentId()StringgetProviderId()StringgetProviderType()StringgetSubType()intgetVersion()Version of the JPA entity used for optimistic lockinginthashCode()booleanisMetadataInitialized()voidsetConfig(Map<String,List<String>> config)voidsetEntityVersion(Integer version)voidsetId(String id)voidsetName(String name)voidsetParent(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
-
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
-
JpaComponentEntity
public JpaComponentEntity()
No-argument constructor, used by hibernate to instantiate entities.
-
JpaComponentEntity
public JpaComponentEntity(DeepCloner cloner)
-
-
Method Detail
-
getParent
public JpaRealmEntity 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
public void setParent(JpaRealmEntity root)
-
isMetadataInitialized
public boolean isMetadataInitialized()
-
getId
public String getId()
- Specified by:
getIdin interfaceAbstractEntity
-
setId
public void setId(String id)
- Specified by:
setIdin interfaceAbstractEntity
-
getEntityVersion
public Integer getEntityVersion()
- Specified by:
getEntityVersionin interfaceJpaRootEntity- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
public void setEntityVersion(Integer version)
- 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
public Integer getCurrentSchemaVersion()
- Specified by:
getCurrentSchemaVersionin interfaceJpaRootEntity
-
getName
public String getName()
- Specified by:
getNamein interfaceMapComponentEntity
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceMapComponentEntity
-
getProviderId
public String getProviderId()
- Specified by:
getProviderIdin interfaceMapComponentEntity
-
setProviderId
public void setProviderId(String providerId)
- Specified by:
setProviderIdin interfaceMapComponentEntity
-
getProviderType
public String getProviderType()
- Specified by:
getProviderTypein interfaceMapComponentEntity
-
setProviderType
public void setProviderType(String providerType)
- Specified by:
setProviderTypein interfaceMapComponentEntity
-
getSubType
public String getSubType()
- Specified by:
getSubTypein interfaceMapComponentEntity
-
setSubType
public void setSubType(String subType)
- Specified by:
setSubTypein interfaceMapComponentEntity
-
getParentId
public String getParentId()
- Specified by:
getParentIdin interfaceMapComponentEntity
-
setParentId
public void setParentId(String parentId)
- Specified by:
setParentIdin interfaceMapComponentEntity
-
getConfig
public Map<String,List<String>> getConfig()
- Specified by:
getConfigin interfaceMapComponentEntity
-
setConfig
public void setConfig(Map<String,List<String>> config)
- Specified by:
setConfigin interfaceMapComponentEntity
-
-