Interface JpaRootEntity
-
- All Superinterfaces:
AbstractEntity
,Serializable
- All Known Subinterfaces:
JpaRootVersionedEntity
- All Known Implementing Classes:
JpaAdminEventEntity
,JpaAuthenticationSessionEntity
,JpaAuthEventEntity
,JpaClientEntity
,JpaClientScopeEntity
,JpaClientSessionEntity
,JpaComponentEntity
,JpaGroupEntity
,JpaPermissionEntity
,JpaPolicyEntity
,JpaRealmEntity
,JpaResourceEntity
,JpaResourceServerEntity
,JpaRoleEntity
,JpaRootAuthenticationSessionEntity
,JpaScopeEntity
,JpaSingleUseObjectEntity
,JpaUserConsentEntity
,JpaUserEntity
,JpaUserFederatedIdentityEntity
,JpaUserLoginFailureEntity
,JpaUserSessionEntity
public interface JpaRootEntity extends AbstractEntity, Serializable
Interface for all root entities in the JPA storage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Integer
getCurrentSchemaVersion()
Integer
getEntityVersion()
void
setEntityVersion(Integer entityVersion)
default boolean
updateEntityVersion()
In case of any update on entity, we want to update the entityVersion to current one.-
Methods inherited from interface org.keycloak.models.map.common.AbstractEntity
getId, setId
-
-
-
-
Method Detail
-
getEntityVersion
Integer getEntityVersion()
- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
void setEntityVersion(Integer entityVersion)
- Parameters:
entityVersion
- sets current supported version to JPA entity.
-
updateEntityVersion
default boolean updateEntityVersion()
In case of any update on entity, we want to update the entityVersion to current one. This includes downgrading from a future version of Keycloak, as the entityVersion must match the JSON and the additional tables this version writes. The listenerJpaEntityVersionListener
calls this method whenever the root entity or one of its children changes. Future versions of this method might restrict downgrading to downgrade only from the next version.- Returns:
true
if the entityVersion was effectively changed,false
otherwise.
-
getCurrentSchemaVersion
Integer getCurrentSchemaVersion()
-
-