Class DbFk.Builder
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.ddl.DbFk.Builder
-
- All Implemented Interfaces:
Builder<DbFk>,Serializable
- Enclosing class:
- DbFk
public static class DbFk.Builder extends Object implements Builder<DbFk>, Serializable
Builder to create immutableDbFkobjects.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DbFk.BuilderaddColumn(String... columns)Adds local columns (from the child table, where the foreign key is defined) to match the ones from the referenced table (parent table).DbFk.BuilderaddColumns(Collection<String> columns)Adds local columns (from the child table, where the foreign key is defined) to match the ones from the referenced table (parent table).DbFk.BuilderaddForeignColumn(String... columns)Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ useaddReferencedColumn(String...)instead.DbFk.BuilderaddForeignColumns(Collection<String> columns)Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ useaddReferencedColumns(Collection)instead.DbFk.BuilderaddReferencedColumn(String... columns)Adds columns from the referenced table (parent table) to match the local ones.DbFk.BuilderaddReferencedColumns(Collection<String> columns)Adds columns from the referenced table (parent table) to match the local ones.DbFkbuild()Builds the final immutable instance.DbFk.BuilderforeignTable(String referencedTable)Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ usereferencedTable(String)instead.DbFk.BuilderreferencedTable(String referencedTable)Sets the name of the referenced table (parent table).
-
-
-
Method Detail
-
foreignTable
@Deprecated public DbFk.Builder foreignTable(String referencedTable)
Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ usereferencedTable(String)instead.Sets the name of the referenced table (parent table).- Parameters:
referencedTable- The referenced table name.- Returns:
- This builder.
-
referencedTable
public DbFk.Builder referencedTable(String referencedTable)
Sets the name of the referenced table (parent table).- Parameters:
referencedTable- The referenced table name.- Returns:
- This builder.
-
addColumn
public DbFk.Builder addColumn(String... columns)
Adds local columns (from the child table, where the foreign key is defined) to match the ones from the referenced table (parent table). These columns will compose the foreign key.- Parameters:
columns- The columns.- Returns:
- This builder.
-
addColumns
public DbFk.Builder addColumns(Collection<String> columns)
Adds local columns (from the child table, where the foreign key is defined) to match the ones from the referenced table (parent table). These columns will compose the foreign key.- Parameters:
columns- The columns.- Returns:
- This builder.
-
addForeignColumn
@Deprecated public DbFk.Builder addForeignColumn(String... columns)
Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ useaddReferencedColumn(String...)instead.Adds columns from the referenced table (parent table) to match the local ones.- Parameters:
columns- The columns.- Returns:
- This builder.
-
addForeignColumns
@Deprecated public DbFk.Builder addForeignColumns(Collection<String> columns)
Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this name is wrong and will eventually be removed ─ useaddReferencedColumns(Collection)instead.Adds columns from the referenced table (parent table) to match the local ones.- Parameters:
columns- The columns.- Returns:
- This builder.
-
addReferencedColumn
public DbFk.Builder addReferencedColumn(String... columns)
Adds columns from the referenced table (parent table) to match the local ones.- Parameters:
columns- The columns.- Returns:
- This builder.
-
addReferencedColumns
public DbFk.Builder addReferencedColumns(Collection<String> columns)
Adds columns from the referenced table (parent table) to match the local ones.- Parameters:
columns- The columns.- Returns:
- This builder.
-
-