Class DDLUtils


  • public class DDLUtils
    extends java.lang.Object
    This helper class provides some useful functions for constructing keys and indexes and other details for tables that are being initialized.
    • Constructor Detail

      • DDLUtils

        public DDLUtils()
    • Method Detail

      • makeForeignKey

        public static ForeignKeyColumnRefs makeForeignKey​(Schema tableSchema,
                                                          TableInfo refTableInfo,
                                                          ConstraintDecl constraintDecl)
        This method constructs a ForeignKeyColumnRefs object that includes the columns named in the input list, as well as the referenced table and column names. Note that this method does not update the schema stored on disk, or create any other supporting files.
        Parameters:
        tableSchema - the schema of the table that the foreign key will be added to
        refTableInfo - the table that the foreign key will reference
        constraintDecl - the parsed constraint declaration describing the foreign key
        Returns:
        an object describing the foreign key
        Throws:
        SchemaNameException - if a column-name cannot be found, or if a column-name is ambiguous (unlikely), or if a column is specified multiple times in the input list.