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 SummaryFields 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 SummaryConstructors 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 SummaryAll 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.DefaultColumngetColumnDescription, getViewParameters
 
- 
 
- 
- 
- 
Field Detail- 
_foreignKeyprotected Pair<String,String> _foreignKey The foreign key: left is table name and right is column name of the referenced column
 - 
_needYearprotected boolean _needYear If the foreign key needs to match the year
 
- 
 - 
Constructor Detail- 
ForeignKeyColumnpublic ForeignKeyColumn(String name, String type, boolean isNullable, Pair<String,String> foreignKey, boolean needYear, String viewName) Constructor.- Parameters:
- name- The name of the column
- type- The SQL type of the column
- isNullable-- trueif it's nullable
- foreignKey- The foreign key
- needYear- If the foreign key needs to match the year
- viewName- The name of the column in the associated SRC_* view
 
 - 
ForeignKeyColumnpublic 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 column
- isNullable-- trueif it's nullable
- foreignKey- The foreign key
- needYear- If the foreign key needs to match the year
 
 
- 
 - 
Method Detail- 
getViewDescriptionpublic String getViewDescription() Description copied from interface:ColumnGet the view description for the view mapping.- Specified by:
- getViewDescriptionin interface- Column
- Overrides:
- getViewDescriptionin class- DefaultColumn
- Returns:
- The column description for a view
 
 
- 
 
-