Class SequenceKeyGeneratorFactory

    • Constructor Detail

      • SequenceKeyGeneratorFactory

        public SequenceKeyGeneratorFactory()
    • Method Detail

      • getAlgorithmName

        public final java.lang.String getAlgorithmName()
        Get name of key generator algorithm.
        Specified by:
        getAlgorithmName in interface KeyGeneratorFactory
        Returns:
        Name of key generator algorithm.
      • hasMandatoryParameters

        public final boolean hasMandatoryParameters()
        Does the algorithm has mandatory parameters and therefore requires a key generator definition in mapping file?
        Specified by:
        hasMandatoryParameters in interface KeyGeneratorFactory
        Returns:
        true if algorithm has mandatory parameters and therefore requires a key generator definition in mapping file. false if algorithm does not require parameters or has only optional parameters.
      • createKeyGenerator

        public final KeyGenerator createKeyGenerator()
                                              throws GeneratorException
        Create a default key generator instance with the algorithm the factory is responsible for. This is only possible for those algorithms that do not require mandatory parameters.
        Specified by:
        createKeyGenerator in interface KeyGeneratorFactory
        Returns:
        A default key generator instance with the algorithm the factory is responsible for.
        Throws:
        GeneratorException - If creation of default key generator is not possible due to required mandatory parameters.
      • createKeyGenerator

        public final KeyGenerator createKeyGenerator​(KeyGeneratorDef definition)
                                              throws GeneratorException
        Create a key generator instance from the given definition with the algorithm the factory is responsible for.
        Specified by:
        createKeyGenerator in interface KeyGeneratorFactory
        Parameters:
        definition - The definition to initialize the key generator.
        Returns:
        A key generator instance initialized with given definition with the algorithm the factory is responsible for.
        Throws:
        GeneratorException - If failed to create a key generator instance.
      • toCreateDDL

        public abstract void toCreateDDL​(KeyGenerator key,
                                         DDLWriter writer)
        Generate create script for given SEQUENCE key generator.
        Parameters:
        key - SEQUENCE key generator to generate DDL for.
        writer - DDLWriter to write schema objects to.
      • toDropDDL

        public abstract void toDropDDL​(KeyGenerator key,
                                       DDLWriter writer)
        Generate drop script for given SEQUENCE key generator.
        Parameters:
        key - SEQUENCE key generator to generate DDL for.
        writer - DDLWriter to write schema objects to.
      • toPrimaryKeyList

        protected final java.lang.String toPrimaryKeyList​(Table table)
        Build a string containing names of all primary key columns separated by '_'.
        Parameters:
        table - Table build primary key column names string for.
        Returns:
        String containing names of all primary key columns separated by '_'.
      • toPrimaryKeyTypeList

        protected final java.lang.String toPrimaryKeyTypeList​(Table table)
        Build a string containing types of all primary key columns separated by '_'.
        Parameters:
        table - Table build primary key column types string for.
        Returns:
        String containing types of all primary key columns separated by '_'.