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>
JPAMapComponentEntity
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 implementingJpaRootVersionedEntity
, this entity will enforce optimistic locking, which can lead toOptimisticLockException
if 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 boolean
equals(Object obj)
Map<String,List<String>>
getConfig()
Integer
getCurrentSchemaVersion()
Integer
getEntityVersion()
String
getId()
String
getName()
JpaRealmEntity
getParent()
Parent entity that should get its optimistic locking version updated upon changes in the childString
getParentId()
String
getProviderId()
String
getProviderType()
String
getSubType()
int
getVersion()
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
isMetadataInitialized()
void
setConfig(Map<String,List<String>> config)
void
setEntityVersion(Integer version)
void
setId(String id)
void
setName(String name)
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
-
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:JpaChildEntity
Parent entity that should get its optimistic locking version updated upon changes in the child- Specified by:
getParent
in interfaceJpaChildEntity<JpaRealmEntity>
-
setParent
public void setParent(JpaRealmEntity root)
-
isMetadataInitialized
public boolean isMetadataInitialized()
-
getId
public String getId()
- Specified by:
getId
in interfaceAbstractEntity
-
setId
public void setId(String id)
- Specified by:
setId
in interfaceAbstractEntity
-
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 version)
- 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
public Integer getCurrentSchemaVersion()
- Specified by:
getCurrentSchemaVersion
in interfaceJpaRootEntity
-
getName
public String getName()
- Specified by:
getName
in interfaceMapComponentEntity
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceMapComponentEntity
-
getProviderId
public String getProviderId()
- Specified by:
getProviderId
in interfaceMapComponentEntity
-
setProviderId
public void setProviderId(String providerId)
- Specified by:
setProviderId
in interfaceMapComponentEntity
-
getProviderType
public String getProviderType()
- Specified by:
getProviderType
in interfaceMapComponentEntity
-
setProviderType
public void setProviderType(String providerType)
- Specified by:
setProviderType
in interfaceMapComponentEntity
-
getSubType
public String getSubType()
- Specified by:
getSubType
in interfaceMapComponentEntity
-
setSubType
public void setSubType(String subType)
- Specified by:
setSubType
in interfaceMapComponentEntity
-
getParentId
public String getParentId()
- Specified by:
getParentId
in interfaceMapComponentEntity
-
setParentId
public void setParentId(String parentId)
- Specified by:
setParentId
in interfaceMapComponentEntity
-
getConfig
public Map<String,List<String>> getConfig()
- Specified by:
getConfig
in interfaceMapComponentEntity
-
setConfig
public void setConfig(Map<String,List<String>> config)
- Specified by:
setConfig
in interfaceMapComponentEntity
-
-