Package org.ametys.odf.ose.db.column
Class ForeignKeyColumn
java.lang.Object
org.ametys.odf.ose.db.column.DefaultColumn
org.ametys.odf.ose.db.column.ForeignKeyColumn
- All Implemented Interfaces:
Column
The definition of a column with a foreign key.
It extends
DefaultColumn
and add the notion of foreign key.
For integrity reasons, the AMETYS_* tables haven't the foreign, it's only used to retrieve values from the SRC_* views.-
Field Summary
Modifier and TypeFieldDescriptionThe foreign key: left is table name and right is column name of the referenced columnprotected boolean
If the foreign key needs to match the yearFields inherited from class org.ametys.odf.ose.db.column.DefaultColumn
_isNullable, _name, _type, _viewName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the view description for the view mapping.Methods inherited from class org.ametys.odf.ose.db.column.DefaultColumn
getColumnDescription, getViewParameters
-
Field Details
-
_foreignKey
The foreign key: left is table name and right is column name of the referenced column -
_needYear
If the foreign key needs to match the year
-
-
Constructor Details
-
ForeignKeyColumn
public ForeignKeyColumn(String name, String type, boolean isNullable, Pair<String, String> foreignKey, boolean needYear, String viewName) Constructor.- Parameters:
name
- The name of the columntype
- The SQL type of the columnisNullable
-true
if it's nullableforeignKey
- The foreign keyneedYear
- If the foreign key needs to match the yearviewName
- The name of the column in the associated SRC_* view
-
ForeignKeyColumn
public ForeignKeyColumn(String name, String type, boolean isNullable, Pair<String, String> foreignKey, boolean needYear) Constructor- Parameters:
name
- The name of the column (it will also be used for the associated SRC_* view)type
- The SQL type of the columnisNullable
-true
if it's nullableforeignKey
- The foreign keyneedYear
- If the foreign key needs to match the year
-
-
Method Details
-
getViewDescription
Description copied from interface:Column
Get the view description for the view mapping.- Specified by:
getViewDescription
in interfaceColumn
- Overrides:
getViewDescription
in classDefaultColumn
- Returns:
- The column description for a view
-