Class JavaBatchSchemaGenerator


  • public class JavaBatchSchemaGenerator
    extends java.lang.Object
    Encapsulates the generation of the Liberty Java Batch schema artifacts. This sql is generated using the Open Liberty tool ddlGen wlp/bin/ddlGen generate fhir-server
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaBatchSchemaGenerator​(java.lang.String schemaName)
      Configures the destination schema for JavaBatch
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGroupAssociationTable​(PhysicalDataModel model)
      Adds the group association table with the following values: CREATE TABLE FHIR_BATCH.GROUPASSOCIATION ( FK_JOBINSTANCEID BIGINT, GROUPNAMES VARCHAR(255)) CREATE INDEX FHIR_BATCH.GA_FKINSTANCEID_IX ON FHIR_BATCH.GROUPASSOCIATION (FK_JOBINSTANCEID) ALTER TABLE FHIR_BATCH.GROUPASSOCIATION ADD CONSTRAINT GRPSSCTNFKJBNSTNCD FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
      void addJobExecutionTable​(PhysicalDataModel model)
      Adds the Job Execution table with the following values: CREATE TABLE FHIR_BATCH.JOBEXECUTION( JOBEXECID BIGINT GENERATED BY DEFAULT AS IDENTITY, BATCHSTATUS INT NOT NULL, CREATETIME TIMESTAMP NOT NULL, ENDTIME TIMESTAMP, EXECNUM INT NOT NULL, EXITSTATUS VARCHAR(2048 OCTETS) NOT NULL, JOBPARAMETERS BLOB(2147483647) INLINE LENGTH 10240, UPDATETIME TIMESTAMP, LOGPATH VARCHAR(512 OCTETS), RESTURL VARCHAR(512 OCTETS), SERVERID VARCHAR(256 OCTETS), STARTTIME TIMESTAMP, FK_JOBINSTANCEID BIGINT NOT NULL, CONSTRAINT PK_JOBEXECUTION PRIMARY KEY (JOBEXECID)) CREATE INDEX FHIR_BATCH.JE_FKINSTANCEID_IX ON FHIR_BATCH.JOBEXECUTION (FK_JOBINSTANCEID) ALTER TABLE FHIR_BATCH.JOBEXECUTION ADD CONSTRAINT JBXCTNFKJBNSTNCEID FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
      void addJobInstanceTable​(PhysicalDataModel model)
      Adds the Job Instance table with the following values: CREATE TABLE FHIR_BATCH.JOBINSTANCE( JOBINSTANCEID BIGINT GENERATED BY DEFAULT AS IDENTITY, AMCNAME VARCHAR(512 OCTETS), BATCHSTATUS INT NOT NULL, CREATETIME TIMESTAMP NOT NULL, EXITSTATUS VARCHAR(2048 OCTETS), INSTANCESTATE INT NOT NULL, JOBNAME VARCHAR(256 OCTETS), JOBXMLNAME VARCHAR(128 OCTETS), JOBXML BLOB(2147483647) INLINE LENGTH 10240, NUMEXECS INT NOT NULL, RESTARTON VARCHAR(128 OCTETS), SUBMITTER VARCHAR(256 OCTETS), UPDATETIME TIMESTAMP, CONSTRAINT PK_JOBINSTANCEID PRIMARY KEY (JOBINSTANCEID) )
      void addJobParameterTable​(PhysicalDataModel model)
      Adds the job table with the following values: CREATE TABLE FHIR_BATCH.JOBPARAMETER ( NAME VARCHAR(255), VALUE VARCHAR(255), FK_JOBEXECID BIGINT) CREATE INDEX FHIR_BATCH.JP_FKJOBEXECID_IX ON FHIR_BATCH.JOBPARAMETER (FK_JOBEXECID) ALTER TABLE FHIR_BATCH.JOBPARAMETER ADD CONSTRAINT JBPRMETERFKJBXECID FOREIGN KEY (FK_JOBEXECID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
      void addRemotablePartitionTable​(PhysicalDataModel model)
      Adds the Remotable Partition table with the following values: CREATE TABLE FHIR_BATCH.REMOTABLEPARTITION ( PARTNUM INTEGER NOT NULL, STEPNAME VARCHAR(255) NOT NULL, INTERNALSTATE INTEGER, LASTUPDATED TIMESTAMP, LOGPATH VARCHAR(512), RESTURL VARCHAR(512), SERVERID VARCHAR(256), FK_JOBEXECUTIONID BIGINT NOT NULL, FK_STEPEXECUTIONID BIGINT, PRIMARY KEY (PARTNUM, STEPNAME, FK_JOBEXECUTIONID)) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMOTABLEPARTITION0 UNIQUE (FK_JOBEXECUTIONID, STEPNAME, PARTNUM) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMTBLPRTFKSTPXCTND FOREIGN KEY (FK_STEPEXECUTIONID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMTBLPRTTFKJBXCTND FOREIGN KEY (FK_JOBEXECUTIONID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
      void addStepThreadExecutionTable​(PhysicalDataModel model)
      Adds the Step Thread Execution table with the following values: CREATE TABLE FHIR_BATCH.STEPTHREADEXECUTION( STEPEXECID BIGINT GENERATED BY DEFAULT AS IDENTITY, THREADTYPE VARCHAR(31 OCTETS), BATCHSTATUS INT NOT NULL, M_COMMIT BIGINT NOT NULL, ENDTIME TIMESTAMP, EXITSTATUS VARCHAR(512 OCTETS), M_FILTER BIGINT NOT NULL, INTERNAL_STATUS INT NOT NULL, PARTNUM INT NOT NULL, USERDATA BLOB(2147483647) INLINE LENGTH 10240 NOT NULL, M_PROCESSSKIP BIGINT NOT NULL, M_READ BIGINT NOT NULL, M_READSKIP BIGINT NOT NULL, M_ROLLBACK BIGINT NOT NULL, STARTTIME TIMESTAMP, STEPNAME VARCHAR(128 OCTETS) NOT NULL, M_WRITE BIGINT NOT NULL, M_WRITESKIP BIGINT NOT NULL, FK_JOBEXECID BIGINT NOT NULL, FK_TOPLVL_STEPEXECID BIGINT NOT NULL, ISPARTITIONEDSTEP SMALLINT, CONSTRAINT PK_STEPTHREADEXECUTION PRIMARY KEY (STEPEXECID)) CREATE INDEX FHIR_BATCH.STE_FKJOBEXECID_IX ON FHIR_BATCH.STEPTHREADEXECUTION (FK_JOBEXECID) CREATE INDEX FHIR_BATCH.STE_FKTLSTEPEID_IX ON FHIR_BATCH.STEPTHREADEXECUTION (FK_TOPLVL_STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHRADEXECUTION0 UNIQUE (FK_JOBEXECID, STEPNAME, PARTNUM) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHFKTPLVLSTPXCD FOREIGN KEY (FK_TOPLVL_STEPEXECID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHRDXCTNFKJBXCD FOREIGN KEY (FK_JOBEXECID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
      void addStepThreadInstanceTable​(PhysicalDataModel model)
      Adds the Step Thread Instance table with the following values: CREATE TABLE FHIR_BATCH.STEPTHREADINSTANCE( PARTNUM BIGINT NOT NULL, STEPNAME VARCHAR(128 OCTETS) NOT NULL, THREADTYPE VARCHAR(31 OCTETS), CHECKPOINTDATA BLOB(2147483647) INLINE LENGTH 10240, FK_JOBINSTANCEID BIGINT NOT NULL, FK_LATEST_STEPEXECID BIGINT NOT NULL, PARTITIONED SMALLINT NOT NULL, PARTITIONPLANSIZE INT, STARTCOUNT INT, CONSTRAINT PK_STEPTHREADINSTANCE PRIMARY KEY (PARTNUM, STEPNAME, FK_JOBINSTANCEID)) CREATE INDEX FHIR_BATCH.STI_FKINSTANCEID_IX ON FHIR_BATCH.STEPTHREADINSTANCE (FK_JOBINSTANCEID) CREATE INDEX FHIR_BATCH.STI_FKLATEST_SEI_IX ON FHIR_BATCH.STEPTHREADINSTANCE (FK_LATEST_STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADINSTANCE ADD CONSTRAINT STPTHRFKLTSTSTPXCD FOREIGN KEY (FK_LATEST_STEPEXECID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADINSTANCE ADD CONSTRAINT STPTHRDNFKJBNSTNCD FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
      void buildJavaBatchSchema​(PhysicalDataModel model)
      Create the tables needed by the Liberty JBatch databaseStore
      protected java.util.List<GroupPrivilege> generateGroupPrivilege()  
      • Methods inherited from class java.lang.Object

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

      • JavaBatchSchemaGenerator

        public JavaBatchSchemaGenerator​(java.lang.String schemaName)
        Configures the destination schema for JavaBatch
        Parameters:
        schemaName -
    • Method Detail

      • buildJavaBatchSchema

        public void buildJavaBatchSchema​(PhysicalDataModel model)
        Create the tables needed by the Liberty JBatch databaseStore
        Parameters:
        model -
      • generateGroupPrivilege

        protected java.util.List<GroupPrivilege> generateGroupPrivilege()
      • addJobParameterTable

        public void addJobParameterTable​(PhysicalDataModel model)
        Adds the job table with the following values: CREATE TABLE FHIR_BATCH.JOBPARAMETER ( NAME VARCHAR(255), VALUE VARCHAR(255), FK_JOBEXECID BIGINT) CREATE INDEX FHIR_BATCH.JP_FKJOBEXECID_IX ON FHIR_BATCH.JOBPARAMETER (FK_JOBEXECID) ALTER TABLE FHIR_BATCH.JOBPARAMETER ADD CONSTRAINT JBPRMETERFKJBXECID FOREIGN KEY (FK_JOBEXECID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
        Parameters:
        model -
      • addGroupAssociationTable

        public void addGroupAssociationTable​(PhysicalDataModel model)
        Adds the group association table with the following values: CREATE TABLE FHIR_BATCH.GROUPASSOCIATION ( FK_JOBINSTANCEID BIGINT, GROUPNAMES VARCHAR(255)) CREATE INDEX FHIR_BATCH.GA_FKINSTANCEID_IX ON FHIR_BATCH.GROUPASSOCIATION (FK_JOBINSTANCEID) ALTER TABLE FHIR_BATCH.GROUPASSOCIATION ADD CONSTRAINT GRPSSCTNFKJBNSTNCD FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
        Parameters:
        model -
      • addStepThreadExecutionTable

        public void addStepThreadExecutionTable​(PhysicalDataModel model)
        Adds the Step Thread Execution table with the following values: CREATE TABLE FHIR_BATCH.STEPTHREADEXECUTION( STEPEXECID BIGINT GENERATED BY DEFAULT AS IDENTITY, THREADTYPE VARCHAR(31 OCTETS), BATCHSTATUS INT NOT NULL, M_COMMIT BIGINT NOT NULL, ENDTIME TIMESTAMP, EXITSTATUS VARCHAR(512 OCTETS), M_FILTER BIGINT NOT NULL, INTERNAL_STATUS INT NOT NULL, PARTNUM INT NOT NULL, USERDATA BLOB(2147483647) INLINE LENGTH 10240 NOT NULL, M_PROCESSSKIP BIGINT NOT NULL, M_READ BIGINT NOT NULL, M_READSKIP BIGINT NOT NULL, M_ROLLBACK BIGINT NOT NULL, STARTTIME TIMESTAMP, STEPNAME VARCHAR(128 OCTETS) NOT NULL, M_WRITE BIGINT NOT NULL, M_WRITESKIP BIGINT NOT NULL, FK_JOBEXECID BIGINT NOT NULL, FK_TOPLVL_STEPEXECID BIGINT NOT NULL, ISPARTITIONEDSTEP SMALLINT, CONSTRAINT PK_STEPTHREADEXECUTION PRIMARY KEY (STEPEXECID)) CREATE INDEX FHIR_BATCH.STE_FKJOBEXECID_IX ON FHIR_BATCH.STEPTHREADEXECUTION (FK_JOBEXECID) CREATE INDEX FHIR_BATCH.STE_FKTLSTEPEID_IX ON FHIR_BATCH.STEPTHREADEXECUTION (FK_TOPLVL_STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHRADEXECUTION0 UNIQUE (FK_JOBEXECID, STEPNAME, PARTNUM) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHFKTPLVLSTPXCD FOREIGN KEY (FK_TOPLVL_STEPEXECID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADEXECUTION ADD CONSTRAINT STPTHRDXCTNFKJBXCD FOREIGN KEY (FK_JOBEXECID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
        Parameters:
        model -
      • addRemotablePartitionTable

        public void addRemotablePartitionTable​(PhysicalDataModel model)
        Adds the Remotable Partition table with the following values: CREATE TABLE FHIR_BATCH.REMOTABLEPARTITION ( PARTNUM INTEGER NOT NULL, STEPNAME VARCHAR(255) NOT NULL, INTERNALSTATE INTEGER, LASTUPDATED TIMESTAMP, LOGPATH VARCHAR(512), RESTURL VARCHAR(512), SERVERID VARCHAR(256), FK_JOBEXECUTIONID BIGINT NOT NULL, FK_STEPEXECUTIONID BIGINT, PRIMARY KEY (PARTNUM, STEPNAME, FK_JOBEXECUTIONID)) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMOTABLEPARTITION0 UNIQUE (FK_JOBEXECUTIONID, STEPNAME, PARTNUM) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMTBLPRTFKSTPXCTND FOREIGN KEY (FK_STEPEXECUTIONID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.REMOTABLEPARTITION ADD CONSTRAINT RMTBLPRTTFKJBXCTND FOREIGN KEY (FK_JOBEXECUTIONID) REFERENCES FHIR_BATCH.JOBEXECUTION (JOBEXECID)
        Parameters:
        model -
      • addJobExecutionTable

        public void addJobExecutionTable​(PhysicalDataModel model)
        Adds the Job Execution table with the following values: CREATE TABLE FHIR_BATCH.JOBEXECUTION( JOBEXECID BIGINT GENERATED BY DEFAULT AS IDENTITY, BATCHSTATUS INT NOT NULL, CREATETIME TIMESTAMP NOT NULL, ENDTIME TIMESTAMP, EXECNUM INT NOT NULL, EXITSTATUS VARCHAR(2048 OCTETS) NOT NULL, JOBPARAMETERS BLOB(2147483647) INLINE LENGTH 10240, UPDATETIME TIMESTAMP, LOGPATH VARCHAR(512 OCTETS), RESTURL VARCHAR(512 OCTETS), SERVERID VARCHAR(256 OCTETS), STARTTIME TIMESTAMP, FK_JOBINSTANCEID BIGINT NOT NULL, CONSTRAINT PK_JOBEXECUTION PRIMARY KEY (JOBEXECID)) CREATE INDEX FHIR_BATCH.JE_FKINSTANCEID_IX ON FHIR_BATCH.JOBEXECUTION (FK_JOBINSTANCEID) ALTER TABLE FHIR_BATCH.JOBEXECUTION ADD CONSTRAINT JBXCTNFKJBNSTNCEID FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
        Parameters:
        model -
      • addStepThreadInstanceTable

        public void addStepThreadInstanceTable​(PhysicalDataModel model)
        Adds the Step Thread Instance table with the following values: CREATE TABLE FHIR_BATCH.STEPTHREADINSTANCE( PARTNUM BIGINT NOT NULL, STEPNAME VARCHAR(128 OCTETS) NOT NULL, THREADTYPE VARCHAR(31 OCTETS), CHECKPOINTDATA BLOB(2147483647) INLINE LENGTH 10240, FK_JOBINSTANCEID BIGINT NOT NULL, FK_LATEST_STEPEXECID BIGINT NOT NULL, PARTITIONED SMALLINT NOT NULL, PARTITIONPLANSIZE INT, STARTCOUNT INT, CONSTRAINT PK_STEPTHREADINSTANCE PRIMARY KEY (PARTNUM, STEPNAME, FK_JOBINSTANCEID)) CREATE INDEX FHIR_BATCH.STI_FKINSTANCEID_IX ON FHIR_BATCH.STEPTHREADINSTANCE (FK_JOBINSTANCEID) CREATE INDEX FHIR_BATCH.STI_FKLATEST_SEI_IX ON FHIR_BATCH.STEPTHREADINSTANCE (FK_LATEST_STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADINSTANCE ADD CONSTRAINT STPTHRFKLTSTSTPXCD FOREIGN KEY (FK_LATEST_STEPEXECID) REFERENCES FHIR_BATCH.STEPTHREADEXECUTION (STEPEXECID) ALTER TABLE FHIR_BATCH.STEPTHREADINSTANCE ADD CONSTRAINT STPTHRDNFKJBNSTNCD FOREIGN KEY (FK_JOBINSTANCEID) REFERENCES FHIR_BATCH.JOBINSTANCE (JOBINSTANCEID)
        Parameters:
        model -
      • addJobInstanceTable

        public void addJobInstanceTable​(PhysicalDataModel model)
        Adds the Job Instance table with the following values: CREATE TABLE FHIR_BATCH.JOBINSTANCE( JOBINSTANCEID BIGINT GENERATED BY DEFAULT AS IDENTITY, AMCNAME VARCHAR(512 OCTETS), BATCHSTATUS INT NOT NULL, CREATETIME TIMESTAMP NOT NULL, EXITSTATUS VARCHAR(2048 OCTETS), INSTANCESTATE INT NOT NULL, JOBNAME VARCHAR(256 OCTETS), JOBXMLNAME VARCHAR(128 OCTETS), JOBXML BLOB(2147483647) INLINE LENGTH 10240, NUMEXECS INT NOT NULL, RESTARTON VARCHAR(128 OCTETS), SUBMITTER VARCHAR(256 OCTETS), UPDATETIME TIMESTAMP, CONSTRAINT PK_JOBINSTANCEID PRIMARY KEY (JOBINSTANCEID) )
        Parameters:
        model -