public class ModelDAO extends AbstractDAO
| Modifier and Type | Class and Description | 
|---|---|
class  | 
ModelDAO.ModelFeatLayerRelation
Class that store information about the feature layers. 
 | 
| Constructor and Description | 
|---|
ModelDAO(java.sql.Connection conn, NFEModel model)
Creates a ModelDAO with the specified connection and model. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addAttributesToFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors)
Adds the specified attributes to the feature table. 
 | 
void | 
addFeatureLayerToModel(NFEFeatureLayer featureLayer, NFEModelMetadata modelMetadata, boolean isPath)
Adds the feature layer record to the table USER_SDO_NFE_MODEL_FTLAYER_REL. 
 | 
void | 
createFeatureClass(NFEModelMetadata modelMetadata, NFEFeatureClass featClass, boolean addPredefinedConnectedPointInfo, boolean addAttributeConstraints)
Persists a feature class. 
 | 
long | 
createFeatureLayer(NFEFeatureLayerMetadata featureLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors)
Creates the feature layer tables and metadata. 
 | 
void | 
createModelSequence(long modelId, java.lang.String ownerTable, java.lang.String sequenceName)
Creates a sequence in database and a record in the model sequence table. 
 | 
NFEModelMetadata | 
createNewModelTables(java.lang.String modelName, NFEEditionMode editionMode, boolean isVersionable)
Creates the needed tables for a new model. 
 | 
void | 
deleteCatalog(NFEModelMetadata modelMetadata, java.lang.Long catalogId)
Deletes the specified catalog. 
 | 
void | 
deleteFeatureClass(NFEModelMetadata nfeModelMetadata, NFEFeatureClass nfeFeatureClass)
Deletes the feature class record from the FT_CLASS_[model_id] table related to the specified feature class and delete the related connected points and attribute constraints information from tables FT_CLASS_DEF_CON_PT_[model_id] and FT_CLASS_ATTR_CSTR_[model_id]. 
 | 
void | 
deleteFeatureClasses(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer)
Deletes the feature classes records from the FT_CLASS_[model_id] table related to the specified feature layer and delete the related connected points and attribute constraints information from tables FT_CLASS_DEF_CON_PT_[model_id] and FT_CLASS_ATTR_CSTR_[model_id]. 
 | 
void | 
deleteFeatureClassesAttributesConstraints(NFEModelMetadata modelMetadata, java.util.Collection<NFEFeatureClass> featureClasses)
Deletes all the attributes constraints related to the specified feature classes in the FT_CLASS_ATTR_CSTR_[model_id] table. 
 | 
void | 
deleteFeatureClassHierarchyRelationship(NFEModelMetadata nfeModelMetadata, NFEFeatureClass featureClass, java.util.Collection<NFEFeatureLayerMetadata> featureLayersMetadata)
Deletes any relation of the class with the hierarchy table (parent or child) 
 | 
void | 
deleteFeatureClassRel(NFEModelMetadata nfeModelMetadata, NFEFeatureClass nfeFeatureClass)
Deletes the records from the table FT_CLASS_REL_[model_id] related to the specified feature class. 
 | 
void | 
deleteFeatureClassRel(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer)
Deletes the records from the table FT_CLASS_REL_[model_id] related to the specified feature classes. 
 | 
void | 
deleteFeatureLayer(NFEFeatureLayerMetadata featureLayerMetadata)
Drops (deletes) a feature layer using the database procedure sdo_net.drop_feature_layer. 
 | 
void | 
deleteFeatureLayerAttributes(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors)
Deletes the attributes for the specified feature layer from the user_sdo_network_user_data view and from the FT_CLASS_ATTR_CSTR_[model_id] and FT_USR_DATA_[model_id] tables. 
 | 
void | 
deleteFeatureLayerToProject(NFEFeatureLayer featureLayer, NFEModelMetadata nfeModelMetadata)
Deletes the feature layer record from the table USER_SDO_NFE_MODEL_FTLAYER_REL. 
 | 
void | 
deleteModel(long modelId)
Deletes model structure. 
 | 
void | 
deleteModelTables(int modelId)
Drops the model's tables and its registry in the Model-Metadata table. 
 | 
void | 
dropAttributeFromFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, NFEAttributeDescriptor attrDescriptor)
Drops the attribute column from the feature table. 
 | 
void | 
dropAttributesFromFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors)
Drops the specified attributes columns from the feature table. 
 | 
void | 
dropFeatureTable(java.lang.String featureTableName)
Drops the feature table with the specified name. 
 | 
java.util.Map<java.lang.Long,java.util.Collection<java.lang.String>> | 
fetchFeatLayersAttributesUsingCatalog(NFEModelMetadata modelMetadata, long catalogId)
Returns a map with as key the feature layer identifiers and as values the list of the attributes using the specified catalog. 
 | 
java.util.Collection<ModelDAO.ModelFeatLayerRelation> | 
fetchModelFeatureLayersRelations(NFEModelMetadata modelMetadata, boolean path)
Returns the feature layers information related to the specified model. 
 | 
java.util.HashMap<java.lang.Long,java.lang.String> | 
fetchModelIdentificators()
Returns a map containing the identifiers and names of all the existing models. 
 | 
NFEModelMetadata | 
fetchModelMetadata(java.lang.String modelName)
Retrieves the metadata for the model whose identifier is specified. 
 | 
java.util.List<NFECatalog> | 
getCatalogs(NFEModel nfeModel)
Returns all the catalogs related to the specified model. 
 | 
boolean | 
hasRelatedRules(NFEFeatureClass featureClass)
Returns true if the feature class is used in any NFE rule, false otherwise. 
 | 
boolean | 
hasRelatedRules(NFEFeatureLayer featureLayer)
Returns true if the feature layer is used in any NFE rule, false otherwise. 
 | 
void | 
initializeTables(NFEModelMetadata metadata)
Creates default values in decision handler rules tables. 
 | 
boolean | 
isFeatureTableEmpty(NFEFeatureClass featureClass)
Returns true if no features belong to the feature class, false otherwise. 
 | 
boolean | 
isFeatureTableEmpty(NFEFeatureLayer featureLayer)
Returns true if no features belong to the feature layer, false otherwise. 
 | 
void | 
loadSequencesRegistry(java.util.Collection<java.lang.String> tableNames, NFEModelMetadata modelMetadata)
Loads the table sequences of the specified tables in the model metadata. 
 | 
boolean | 
modelExists(java.lang.String modelName)
Returns true if a model already exists with the specified name, false otherwise. 
 | 
void | 
registerDBScripts(java.util.Collection<java.lang.String> scripts)
Registers the specified scripts in the database. 
 | 
java.util.Collection<NFEAttributeDescriptor> | 
registerFeatureLayerAttributes(NFEModelMetadata modelMetadata, NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors)
Registers the given attributes to the network and feature layer in xxx_sdo_network_data. 
 | 
void | 
relateNetworkToModel(long modelId, java.lang.String networkName)
Relates a network with an NFE Model. 
 | 
void | 
removeModelSequence(long modelId, java.lang.String sequenceName)
Removes a sequence in database and the corresponding record in the model sequence table. 
 | 
void | 
removePointCardRule(NFEModelMetadata modelMetadata, NFEFeatureClass featClass)
Removes the point cardinality rule from the point cardinality rule table related to the specified feature class. 
 | 
void | 
removePointCardRule(NFEModelMetadata modelMetadata, NFEFeatureLayer featureLayer)
Removes the point cardinality rule from the point cardinality rule table related to the specified feature layer. 
 | 
void | 
saveCatalog(NFEModelMetadata modelMetadata, NFECatalog catalog)
Persists the catalog in the tables FT_USR_DATA_CATLG_[model_id] and FT_USR_DATA_CVAL_[model_id]. 
 | 
void | 
updateAttributeConstraints(NFEModelMetadata modelMetadata, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue)
Updates the attribute default value. 
 | 
void | 
updateCatalogValues(NFEModelMetadata modelMetadata, long catalogId, java.util.Collection<NFECatalogValue> catalogValues)
Updates the catalog values of the specified catalog. 
 | 
void | 
updateFeatureClass(NFEModel nfeModel, NFEFeatureClass featureClass, boolean addPredefinedConnectedPointInfo, boolean addAttributeConstraints)
Updates the feature class. 
 | 
void | 
updateFeatureLayerZOrder(NFEModelMetadata modelMetadata, NFEFeatureLayer featLayer)
Updates the feature layers Z-order. 
 | 
getConnection, getModel, getSQLValidator
public ModelDAO(java.sql.Connection conn,
                NFEModel model)
conn - connectionmodel - model
public void registerDBScripts(java.util.Collection<java.lang.String> scripts)
                       throws NFEIOException
scripts - scriptsNFEIOException - if an NFE error occurs.
public boolean modelExists(java.lang.String modelName)
                    throws NFEIOException
modelName - model nameNFEIOException - if an NFE error occurs.public NFEModelMetadata createNewModelTables(java.lang.String modelName, NFEEditionMode editionMode, boolean isVersionable) throws NFEIOException
NFEResources#SQL_NFE_PACKAGE_BODY_SCRIPT_NAME located in NFEResources#SCRIPTS_PATH.modelName - model nameeditionMode - edition modeisVersionable - true if the model is versionable, false otherwise.NFEIOException - if an NFE error occurs.
public void deleteModelTables(int modelId)
                       throws NFEIOException
modelId - Identifier of the modelNFEIOException - if an NFE error occurs.
public void relateNetworkToModel(long modelId,
                                 java.lang.String networkName)
                          throws NFEIOException
modelId - Identifier of the modelnetworkName - network nameNFEIOException - if an NFE error occurs.public NFEModelMetadata fetchModelMetadata(java.lang.String modelName) throws NFEIOException
modelName - model nameNFEIOException - if an NFE error occurs.
public void loadSequencesRegistry(java.util.Collection<java.lang.String> tableNames,
                                  NFEModelMetadata modelMetadata)
                           throws NFEIOException
tableNames - table namesmodelMetadata - model metadataNFEIOException - if an NFE error occurs.
public void createModelSequence(long modelId,
                                java.lang.String ownerTable,
                                java.lang.String sequenceName)
                         throws NFEIOException
modelId - model identifierownerTable - table for which the sequence was createdsequenceName - sequence nameNFEIOException - if an NFE error occurs.
public void removeModelSequence(long modelId,
                                java.lang.String sequenceName)
                         throws NFEIOException
modelId - model identifiersequenceName - sequence nameNFEIOException - if an NFE error occurs.public void initializeTables(NFEModelMetadata metadata) throws NFEIOException
metadata - model metadataNFEIOException - if an NFE error occurs.
public void deleteModel(long modelId)
                 throws NFEIOException
modelId - model identifierNFEIOException - if an NFE error occurs.public long createFeatureLayer(NFEFeatureLayerMetadata featureLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors) throws NFEIOException
featureLayerMetadata - feature layer metadataattributeDescriptors - attributes descriptors of the feature tableNFEIOException - if an NFE error occurs.public java.util.Collection<NFEAttributeDescriptor> registerFeatureLayerAttributes(NFEModelMetadata modelMetadata, NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors) throws NFEIOException
modelMetadata - model metadatafeatLayerMetadata - feature layer metadataattributeDescriptors - attribute descriptorsNFEIOException - if an NFE error occurs.public void createFeatureClass(NFEModelMetadata modelMetadata, NFEFeatureClass featClass, boolean addPredefinedConnectedPointInfo, boolean addAttributeConstraints) throws NFEIOException
modelMetadata - model metadatafeatClass - feature classaddPredefinedConnectedPointInfo - true if the predefined connected points should be added, false otherwiseaddAttributeConstraints - true if the attribute constraints should be added, false otherwiseNFEIOException - if an NFE error occurs.public void removePointCardRule(NFEModelMetadata modelMetadata, NFEFeatureClass featClass) throws NFEIOException
modelMetadata - model metadatafeatClass - feature classNFEIOException - if an NFE error occurs.public void removePointCardRule(NFEModelMetadata modelMetadata, NFEFeatureLayer featureLayer) throws NFEIOException
modelMetadata - model metadatafeatureLayer - feature layerNFEIOException - if an NFE error occurs.public void addFeatureLayerToModel(NFEFeatureLayer featureLayer, NFEModelMetadata modelMetadata, boolean isPath) throws NFEIOException
featureLayer - feature layermodelMetadata - model metadataisPath - true if the feature layer is a path feature layer, false otherwiseNFEIOException - if an NFE error occurs.
public void dropFeatureTable(java.lang.String featureTableName)
                      throws NFEIOException
featureTableName - feature table nameNFEIOException - if an NFE error occurs.
public java.util.HashMap<java.lang.Long,java.lang.String> fetchModelIdentificators()
                                                                            throws NFEIOException
NFEIOException - if an NFE error occurs.public void deleteFeatureLayer(NFEFeatureLayerMetadata featureLayerMetadata) throws NFEIOException
featureLayerMetadata - feature layer metadataNFEIOException - if an NFE error occurs.public void addAttributesToFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors) throws NFEIOException
featLayerMetadata - feature layer metadataattributeDescriptors - attribute descriptorsNFEIOException - if an NFE error occurs.public void updateFeatureClass(NFEModel nfeModel, NFEFeatureClass featureClass, boolean addPredefinedConnectedPointInfo, boolean addAttributeConstraints) throws NFEIOException
nfeModel - modelfeatureClass - feature classaddPredefinedConnectedPointInfo - true if the predefined connected points should be updated, false otherwiseaddAttributeConstraints - true if the attribute constraints should be updated, false otherwiseNFEIOException - if an NFE error occurs.public void dropAttributesFromFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors) throws NFEIOException
featLayerMetadata - feature layer metadataattributeDescriptors - attribute descriptorsNFEIOException - if an NFE error occurs.public void updateFeatureLayerZOrder(NFEModelMetadata modelMetadata, NFEFeatureLayer featLayer) throws NFEIOException
modelMetadata - model metadatafeatLayer - feature layers to updateNFEIOException - if an NFE error occurs.public void deleteFeatureClassHierarchyRelationship(NFEModelMetadata nfeModelMetadata, NFEFeatureClass featureClass, java.util.Collection<NFEFeatureLayerMetadata> featureLayersMetadata) throws NFEIOException
nfeModelMetadata - model metadatafeatureClass - feature classfeatureLayersMetadata - The metadata of the featurelayers that could have any feature of the feature class as parent.NFEIOException - if an NFE error occurs.public void deleteFeatureClassRel(NFEModelMetadata nfeModelMetadata, NFEFeatureClass nfeFeatureClass) throws NFEIOException
nfeModelMetadata - model metadatanfeFeatureClass - feature classNFEIOException - if an NFE error occurs.public void dropAttributeFromFeatureTable(NFEFeatureLayerMetadata featLayerMetadata, NFEAttributeDescriptor attrDescriptor) throws NFEIOException
featLayerMetadata - feature layer metadataattrDescriptor - attribute to dropNFEIOException - if an NFE error occurs.public void deleteFeatureClass(NFEModelMetadata nfeModelMetadata, NFEFeatureClass nfeFeatureClass) throws NFEIOException
nfeModelMetadata - model metadatanfeFeatureClass - feature classNFEIOException - if an NFE error occurs.public void deleteFeatureClassesAttributesConstraints(NFEModelMetadata modelMetadata, java.util.Collection<NFEFeatureClass> featureClasses) throws NFEIOException
modelMetadata - model metadatafeatureClasses - feature classesjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic void deleteFeatureLayerAttributes(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer, java.util.Collection<NFEAttributeDescriptor> attributeDescriptors) throws NFEIOException
nfeModelMetadata - model metadatanfeFeatureLayer - feature layerattributeDescriptors - attribute descriptorsNFEIOException - if an NFE error occurs.public void deleteFeatureClasses(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer) throws NFEIOException
nfeModelMetadata - model metadatanfeFeatureLayer - feature layerNFEIOException - if an NFE error occurs.public void deleteFeatureLayerToProject(NFEFeatureLayer featureLayer, NFEModelMetadata nfeModelMetadata) throws NFEIOException
featureLayer - feature layernfeModelMetadata - model metadataNFEIOException - if an NFE error occurs.public void deleteFeatureClassRel(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer) throws NFEIOException
nfeModelMetadata - model metadatanfeFeatureLayer - feature layerNFEIOException - if an NFE error occurs.public void saveCatalog(NFEModelMetadata modelMetadata, NFECatalog catalog) throws NFEIOException
modelMetadata - model metadatacatalog - catalogNFEIOException - if an NFE error occurs.public boolean hasRelatedRules(NFEFeatureClass featureClass) throws NFEIOException
featureClass - feature classjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic boolean hasRelatedRules(NFEFeatureLayer featureLayer) throws NFEIOException
featureLayer - feature layerjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic boolean isFeatureTableEmpty(NFEFeatureClass featureClass) throws NFEIOException
featureClass - feature classjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic boolean isFeatureTableEmpty(NFEFeatureLayer featureLayer) throws NFEIOException
featureLayer - feature layerjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic java.util.List<NFECatalog> getCatalogs(NFEModel nfeModel) throws NFEIOException
nfeModel - modelNFEIOException - if an NFE error occurs.public void updateCatalogValues(NFEModelMetadata modelMetadata, long catalogId, java.util.Collection<NFECatalogValue> catalogValues) throws NFEIOException, java.sql.SQLException
modelMetadata - model metadatacatalogId - catalog identifiercatalogValues - new catalog valuesjava.sql.SQLException - if an SQL exception is thrown.NFEIOExceptionpublic java.util.Map<java.lang.Long,java.util.Collection<java.lang.String>> fetchFeatLayersAttributesUsingCatalog(NFEModelMetadata modelMetadata, long catalogId) throws NFEIOException
modelMetadata - model metadatacatalogId - catalog identifierNFEIOException - if an NFE error occurs.public void deleteCatalog(NFEModelMetadata modelMetadata, java.lang.Long catalogId) throws NFEIOException
modelMetadata - model metadatacatalogId - catalog identifierNFEIOException - if an NFE error occurs.public void updateAttributeConstraints(NFEModelMetadata modelMetadata, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue) throws NFEIOException
modelMetadata - model metadatafeatureClassId - feature class identifierattributeName - attribute namenewValue - new attribute default valueNFEIOException - if an NFE error occurs.public java.util.Collection<ModelDAO.ModelFeatLayerRelation> fetchModelFeatureLayersRelations(NFEModelMetadata modelMetadata, boolean path) throws NFEIOException
modelMetadata - model metadatapath - true if the information to load belongs to the path feature layer, false otherwiseNFEIOException - if an NFE error occurs.