Interface JpaRootEntity

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