Interface JpaRootEntity

All Superinterfaces:
AbstractEntity, Serializable
All Known Subinterfaces:
JpaRootVersionedEntity
All Known Implementing Classes:
JpaAdminEventEntity, JpaAuthenticationSessionEntity, JpaAuthEventEntity, JpaClientEntity, JpaClientScopeEntity, JpaClientSessionEntity, JpaComponentEntity, JpaGroupEntity, JpaLockEntity, 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 Details

    • 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 listener JpaEntityVersionListener 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()