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
public class ForeignKeyColumn extends DefaultColumn
The definition of a column with a foreign key. It extendsDefaultColumnand 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
Fields Modifier and Type Field Description protected Pair<String,String>_foreignKeyThe foreign key: left is table name and right is column name of the referenced columnprotected boolean_needYearIf the foreign key needs to match the year- 
Fields inherited from class org.ametys.odf.ose.db.column.DefaultColumn
_isNullable, _name, _type, _viewName 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ForeignKeyColumn(String name, String type, boolean isNullable, Pair<String,String> foreignKey, boolean needYear)ConstructorForeignKeyColumn(String name, String type, boolean isNullable, Pair<String,String> foreignKey, boolean needYear, String viewName)Constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetViewDescription()Get the view description for the view mapping.- 
Methods inherited from class org.ametys.odf.ose.db.column.DefaultColumn
getColumnDescription, getViewParameters 
 - 
 
 - 
 
- 
- 
Field Detail
- 
_foreignKey
protected Pair<String,String> _foreignKey
The foreign key: left is table name and right is column name of the referenced column 
- 
_needYear
protected boolean _needYear
If the foreign key needs to match the year 
 - 
 
- 
Constructor Detail
- 
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-trueif 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-trueif it's nullableforeignKey- The foreign keyneedYear- If the foreign key needs to match the year
 
 - 
 
- 
Method Detail
- 
getViewDescription
public String getViewDescription()
Description copied from interface:ColumnGet the view description for the view mapping.- Specified by:
 getViewDescriptionin interfaceColumn- Overrides:
 getViewDescriptionin classDefaultColumn- Returns:
 - The column description for a view
 
 
 - 
 
 -