Class RelationalSchemaGenerator
- java.lang.Object
-
- org.openforis.collect.relational.model.RelationalSchemaGenerator
-
public class RelationalSchemaGenerator extends Object
- Author:
- G. Miceli, S. Ricci
-
-
Constructor Summary
Constructors Constructor Description RelationalSchemaGenerator()RelationalSchemaGenerator(RelationalSchemaConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAncestorKeyColumns(DataTable table)protected voidaddPKColumn(DataTable table)protected voidaddPKConstraint(org.openforis.collect.relational.model.AbstractTable<?> table, Column<?> pkColumn)protected PathcreateAncestorKeyRelativePath(int depth, FieldDefinition<?> field)protected CodeTablecreateCodeListTable(RelationalSchema rs, CodeList codeList, CodeTable parent, Integer hierarchyIdx)RelationalSchemagenerateSchema(Survey survey, String schemaName)protected StringgetAncestorKeyColumnName(AttributeDefinition keyDefn)protected FieldDefinition<?>getKeyAttributeValueFieldDefinition(AttributeDefinition defn)protected booleanisQualifiable(CodeList list)voidsetConfig(RelationalSchemaConfig config)
-
-
-
Constructor Detail
-
RelationalSchemaGenerator
public RelationalSchemaGenerator()
-
RelationalSchemaGenerator
public RelationalSchemaGenerator(RelationalSchemaConfig config)
-
-
Method Detail
-
generateSchema
public RelationalSchema generateSchema(Survey survey, String schemaName) throws CollectRdbException
- Throws:
CollectRdbException
-
createCodeListTable
protected CodeTable createCodeListTable(RelationalSchema rs, CodeList codeList, CodeTable parent, Integer hierarchyIdx) throws CollectRdbException
- Throws:
CollectRdbException
-
addPKColumn
protected void addPKColumn(DataTable table)
-
addAncestorKeyColumns
protected void addAncestorKeyColumns(DataTable table) throws CollectRdbException
- Throws:
CollectRdbException
-
getKeyAttributeValueFieldDefinition
protected FieldDefinition<?> getKeyAttributeValueFieldDefinition(AttributeDefinition defn)
-
getAncestorKeyColumnName
protected String getAncestorKeyColumnName(AttributeDefinition keyDefn)
-
createAncestorKeyRelativePath
protected Path createAncestorKeyRelativePath(int depth, FieldDefinition<?> field)
-
addPKConstraint
protected void addPKConstraint(org.openforis.collect.relational.model.AbstractTable<?> table, Column<?> pkColumn)
-
isQualifiable
protected boolean isQualifiable(CodeList list)
-
setConfig
public void setConfig(RelationalSchemaConfig config)
-
-