Class DbFk
- java.lang.Object
-
- com.feedzai.commons.sql.abstraction.ddl.DbFk
-
- All Implemented Interfaces:
Serializable
public class DbFk extends Object implements Serializable
Represents a database foreign key hard link between two tables.- Since:
- 2.0.0
- Author:
- Rui Vilao (rui.vilao@feedzai.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbFk.BuilderBuilder to create immutableDbFkobjects.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)List<String>getForeignColumns()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 ─ usegetReferencedColumns()instead.StringgetForeignTable()Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this method was used to get the name of the referenced table, which is the parent table, thus the name of the method is wrong and it will eventually be removed ─ usegetReferencedTable()instead.List<String>getLocalColumns()Gets the local columns names.List<String>getReferencedColumns()Gets the referenced columns names.StringgetReferencedTable()Gets the name of the referenced table (parent table).inthashCode()
-
-
-
Method Detail
-
getLocalColumns
public List<String> getLocalColumns()
Gets the local columns names. These columns are from the local table where the foreign key is defined (the child table); this group of columns is what composes the foreign key.- Returns:
- The local columns names.
-
getForeignColumns
@Deprecated public List<String> getForeignColumns()
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 ─ usegetReferencedColumns()instead.Gets the referenced columns names. These columns are from the table that the foreign key constraint references (the parent table); the values in these columns need to match the values in the local columns that define the foreign key.- Returns:
- The list of referenced columns names.
-
getReferencedColumns
public List<String> getReferencedColumns()
Gets the referenced columns names. These columns are from the table that the foreign key constraint references (the parent table); the values in these columns need to match the values in the local columns that define the foreign key.- Returns:
- The list of referenced columns names.
-
getForeignTable
@Deprecated public String getForeignTable()
Deprecated.a "foreign key" is actually composed from the local columns of the table where it is defined (the child table); this method was used to get the name of the referenced table, which is the parent table, thus the name of the method is wrong and it will eventually be removed ─ usegetReferencedTable()instead.Gets the name of the referenced table (parent table).- Returns:
- The name of the referenced table.
-
getReferencedTable
public String getReferencedTable()
Gets the name of the referenced table (parent table).- Returns:
- The name of the referenced table.
-
-