Class SchemaVersionsManager


  • public class SchemaVersionsManager
    extends java.lang.Object
    Access layer for WHOLE_SCHEMA_VERSION data
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getVersionForSchema()
      Get the installed version for the schema
      boolean isSchemaOld()
      Returns true if the current schema version recorded in WHOLE_SCHEMA_VERSION is older the last version in FhirSchemaVersion and therefore needs to be updated
      boolean isSchemaVersionMatch()
      Returns true if the current schema version recorded in WHOLE_SCHEMA_VERSION exactly matches the last version in FhirSchemaVersion
      void updateSchemaVersion()
      Find the latest FhirSchemaVersion and use it to update the WHOLE_SCHEMA_VERSION table
      void updateSchemaVersionId​(int versionId)
      Record the version information for the given schemaName in the WHOLESCHEMA_VERSION table, creating a new record if required
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SchemaVersionsManager

        public SchemaVersionsManager​(IDatabaseTranslator translator,
                                     IConnectionProvider connectionPool,
                                     ITransactionProvider transactionProvider,
                                     java.lang.String schemaName,
                                     int latestCodeVersion)
        Public constructor
        Parameters:
        translator -
        connectionPool -
        transactionProvider -
        schemaName -
        latestCodeVersion -
    • Method Detail

      • getVersionForSchema

        public int getVersionForSchema()
        Get the installed version for the schema
        Returns:
        the schema version, or -1 if no schema build has completed yet
      • updateSchemaVersionId

        public void updateSchemaVersionId​(int versionId)
        Record the version information for the given schemaName in the WHOLESCHEMA_VERSION table, creating a new record if required
        Parameters:
        schemaName -
        versionId -
      • updateSchemaVersion

        public void updateSchemaVersion()
        Find the latest FhirSchemaVersion and use it to update the WHOLE_SCHEMA_VERSION table
      • isSchemaOld

        public boolean isSchemaOld()
        Returns true if the current schema version recorded in WHOLE_SCHEMA_VERSION is older the last version in FhirSchemaVersion and therefore needs to be updated
        Returns:
      • isSchemaVersionMatch

        public boolean isSchemaVersionMatch()
        Returns true if the current schema version recorded in WHOLE_SCHEMA_VERSION exactly matches the last version in FhirSchemaVersion
        Returns: