Class VersionHistoryService

    • Constructor Detail

      • VersionHistoryService

        public VersionHistoryService​(String adminSchemaName,
                                     String... schemaNames)
    • Method Detail

      • init

        public void init()
        Fetch the version history map for the given schema. This then becomes the reference for everything we try to apply going forward. This assumes, of course. If someone else comes along and tries to update the schema after we read this map, then it's possible (likely) that we'll try to apply a change that is no longer required, which is probably going to end in tears. But it's OK. A second attempt will see that the change has already been applied, so won't try again.
      • insertVersionHistoriesInTx

        public void insertVersionHistoriesInTx​(Collection<VersionHistoryService.TypeNameVersion> versionHistories)
        Insert all the entries in the versionHistoryMap. This must be called in the context of an existing transaction
        Parameters:
        versionHistories -
      • insertVersionHistoryInTx

        public void insertVersionHistoryInTx​(String objectSchema,
                                             String objectType,
                                             String objectName,
                                             int version)
        Insert the version history for the objectType/objectName/version.
        Parameters:
        objectSchema -
        objectType -
        objectName -
        version -
      • clearVersionHistory

        public void clearVersionHistory​(String objectSchema)
        Remove the version history information for all objects in the given schema
        Parameters:
        objectSchema -
      • insertVersionHistory

        public void insertVersionHistory​(Collection<VersionHistoryService.TypeNameVersion> versionHistories)
        Insert all the entries in the versionHistoryMap in a new transaction (useful for testing).
        Parameters:
        versionHistories -