Class FeatureDAO
- java.lang.Object
-
- oracle.spatial.network.nfe.io.jdbc.dao.AbstractDAO
-
- oracle.spatial.network.nfe.io.jdbc.dao.FeatureDAO
-
public class FeatureDAO extends AbstractDAO
The FeatureDAO data access object provides methods to load and manage the model features. It is not recommended to use the data access objects methods, instead use the NFE services.
-
-
Field Summary
-
Fields inherited from class oracle.spatial.network.nfe.io.jdbc.dao.AbstractDAO
conn
-
-
Constructor Summary
Constructors Constructor Description FeatureDAO(java.sql.Connection conn, NFEModel model)
Creates a FeatureDAO with the specified connection and model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteDanglingFeatureElements(NFEFeatureLayerMetadata metadata)
Deletes feature elements that refer to features that do not exist.void
deleteFeatureElements(java.util.Collection<NFEFeatureElement> featElems)
Deletes the feature elements from the feature element relationship table.void
deleteFeatureParentRelationship(NFEFeature feature)
Deletes the feature parent relationship where the feature is parent or child.void
deleteFeatures(java.util.Collection<NFEFeature> features)
Deletes the features in the feature and hierarchy tables, also deletes the record in the feature class relationship table.java.util.Collection<NFEAttributeDescriptor>
fetchFeatureLayerAttributeDescriptors(NFEFeatureLayerMetadata featLayerMetadata)
Fetches the attribute descriptors of the specified feature layer.java.util.Collection<NFEFeatureLayerMetadata>
fetchFeatureLayersMetadata(NFEModelMetadata modelMetadata, java.util.Collection<java.lang.Long> featLayerIds)
Fetches the metadata of the specified feature layers.java.util.List<java.lang.Long>
findFeaturesIds(NFEModelMetadata nfeModelMetadata, NFESearchParams searchParams)
Searches features.java.util.List<FeatureAttributeDescriptor>
getAttributesPerFeature(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureId)
Returns the workspace attribute descriptors related to the specified feature.java.util.List<NFEFeature>
getChildFeatures(NFEModel nfeModel, NFEFeature nfeFeature)
Returns the children of the specified feature.java.lang.Long
getFeatureClassIdOfFeature(NFEModelMetadata nfeModelMetadata, java.lang.Long featureId, java.util.Collection<NFEFeatureClass> featureClasses)
Returns the feature class identifier of the specified featurejava.lang.String
getParentForFeature(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureId)
Returns the value of the column NFE_PARENT$ and NFE_PARENT_LAYER$ that is in the feature table.java.util.List<java.lang.Long>
getRelatedLinkIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId)
Returns the links identifiers of links related to the feature.java.util.List<java.lang.Long>
getRelatedNodeIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId)
Returns the nodes identifiers of the nodes related to the feature.void
loadFeatureClasses(NFEFeatureLayer featLayer)
Loads the feature classes of the specified feature layer.void
loadFeatureLayerContent(NFEFeatureLayer featLayer, java.util.Collection<NFENetworkElement> netElements)
Loads the features and rules instances related to the specified feature layer and network elements.java.util.List<NFEFeature>
loadNetElementFeatures(NFEFeatureLayer featureLayer, NFENetworkElement networkElement)
Loads the features related to the specified network element.void
saveFeatureElements(java.util.Collection<NFEFeatureElement> featElems)
Saves the new feature elements in the feature element relationship table.void
saveFeatures(java.util.Collection<NFEFeature> features)
Saves the new features in the feature and hierarchy tables, also creates a record in the feature class relationship table.void
updateAttributeForFeatures(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue, java.lang.String oldValue)
Updates the attributes for the features having the value oldValue and belonging to the specified feature class to newValue.void
updateFeatureElements(java.util.Collection<NFEFeatureElement> featElems)
Updates the feature elements in the feature element relationship table.void
updateFeatureHierarchy(NFEFeature feature)
Updates the feature hierarchy in the feature and hierarchy tables.void
updateFeatures(java.util.Collection<NFEFeature> features)
Updates the features attributes and parents information.-
Methods inherited from class oracle.spatial.network.nfe.io.jdbc.dao.AbstractDAO
close, close, execute, execute, executeQuery, executeUpdate, getConnection, getModel, getSQLValidator
-
-
-
-
Constructor Detail
-
FeatureDAO
public FeatureDAO(java.sql.Connection conn, NFEModel model)
Creates a FeatureDAO with the specified connection and model.- Parameters:
conn
- connectionmodel
- model
-
-
Method Detail
-
saveFeatures
public void saveFeatures(java.util.Collection<NFEFeature> features) throws NFEIOException
Saves the new features in the feature and hierarchy tables, also creates a record in the feature class relationship table. This method doesn't save the network elements used by the features neither the feature elements.- Parameters:
features
- features- Throws:
NFEIOException
- if an NFE error occurs.
-
updateFeatures
public void updateFeatures(java.util.Collection<NFEFeature> features) throws NFEIOException
Updates the features attributes and parents information.- Parameters:
features
- features- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatures
public void deleteFeatures(java.util.Collection<NFEFeature> features) throws NFEIOException
Deletes the features in the feature and hierarchy tables, also deletes the record in the feature class relationship table. This method doesn't delete the network elements used by the features neither the feature elements.- Parameters:
features
- features- Throws:
NFEIOException
- if an NFE error occurs.
-
saveFeatureElements
public void saveFeatureElements(java.util.Collection<NFEFeatureElement> featElems) throws NFEIOException
Saves the new feature elements in the feature element relationship table.- Parameters:
featElems
- feature elements- Throws:
NFEIOException
- if an NFE error occurs.
-
updateFeatureElements
public void updateFeatureElements(java.util.Collection<NFEFeatureElement> featElems) throws NFEIOException
Updates the feature elements in the feature element relationship table.- Parameters:
featElems
- feature elements- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatureElements
public void deleteFeatureElements(java.util.Collection<NFEFeatureElement> featElems) throws NFEIOException
Deletes the feature elements from the feature element relationship table.- Parameters:
featElems
- feature elements- Throws:
NFEIOException
- if an NFE error occurs.
-
loadFeatureLayerContent
public void loadFeatureLayerContent(NFEFeatureLayer featLayer, java.util.Collection<NFENetworkElement> netElements) throws NFEIOException
Loads the features and rules instances related to the specified feature layer and network elements.- Parameters:
featLayer
- feature layernetElements
- network elements- Throws:
NFEIOException
- if an NFE error occurs.
-
fetchFeatureLayersMetadata
public java.util.Collection<NFEFeatureLayerMetadata> fetchFeatureLayersMetadata(NFEModelMetadata modelMetadata, java.util.Collection<java.lang.Long> featLayerIds) throws NFEIOException
Fetches the metadata of the specified feature layers.- Parameters:
modelMetadata
- model metadatafeatLayerIds
- feature layers identifiers- Returns:
- feature layers metadata
- Throws:
NFEIOException
- if an NFE error occurs.
-
fetchFeatureLayerAttributeDescriptors
public java.util.Collection<NFEAttributeDescriptor> fetchFeatureLayerAttributeDescriptors(NFEFeatureLayerMetadata featLayerMetadata) throws NFEIOException
Fetches the attribute descriptors of the specified feature layer.- Parameters:
featLayerMetadata
- feature layer metadata- Returns:
- attribute descriptors
- Throws:
NFEIOException
- if an NFE error occurs.
-
loadFeatureClasses
public void loadFeatureClasses(NFEFeatureLayer featLayer) throws NFEIOException
Loads the feature classes of the specified feature layer.- Parameters:
featLayer
- feature layer- Throws:
NFEIOException
- if an NFE error occurs.
-
getFeatureClassIdOfFeature
public java.lang.Long getFeatureClassIdOfFeature(NFEModelMetadata nfeModelMetadata, java.lang.Long featureId, java.util.Collection<NFEFeatureClass> featureClasses) throws NFEIOException
Returns the feature class identifier of the specified feature- Parameters:
nfeModelMetadata
- model metadatafeatureId
- feature idfeatureClasses
- the possible feature class the feature could belong to (should be all the feature class of the feature layer the features belongs to)- Returns:
- the feature class identifier
- Throws:
NFEIOException
- if an NFE error occurs.
-
getRelatedNodeIdsForFeature
public java.util.List<java.lang.Long> getRelatedNodeIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId) throws NFEIOException
Returns the nodes identifiers of the nodes related to the feature.- Parameters:
featureLayer
- feature layerfeatureId
- feature identifier- Returns:
- list of nodes identifiers
- Throws:
NFEIOException
- if an NFE error occurs.
-
getRelatedLinkIdsForFeature
public java.util.List<java.lang.Long> getRelatedLinkIdsForFeature(NFEFeatureLayer featureLayer, java.lang.Long featureId) throws NFEIOException
Returns the links identifiers of links related to the feature.- Parameters:
featureLayer
- feature layerfeatureId
- feature identifier- Returns:
- list of links identifiers
- Throws:
NFEIOException
- if an NFE error occurs.
-
loadNetElementFeatures
public java.util.List<NFEFeature> loadNetElementFeatures(NFEFeatureLayer featureLayer, NFENetworkElement networkElement) throws NFEIOException
Loads the features related to the specified network element.- Parameters:
featureLayer
- feature layer of the featurenetworkElement
- network element- Returns:
- list of feature
- Throws:
NFEIOException
- if an NFE error occurs.
-
getAttributesPerFeature
public java.util.List<FeatureAttributeDescriptor> getAttributesPerFeature(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureId) throws NFEIOException
Returns the workspace attribute descriptors related to the specified feature.- Parameters:
nfeFeatureLayer
- feature layer of the featurefeatureId
- feature identifier- Returns:
- workspace attribute descriptors
- Throws:
NFEIOException
- if an NFE error occurs.
-
getParentForFeature
public java.lang.String getParentForFeature(NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureId) throws NFEIOException
Returns the value of the column NFE_PARENT$ and NFE_PARENT_LAYER$ that is in the feature table. NFE_PARENT$ is the feature identifier of the parent. NFE_PARENT_LAYER$ is the feature layer identifier of the parent. If not null the parent is returned in the format NFE_PARENT_LAYER$-NFE_PARENT, else an empty string is returned.- Parameters:
nfeFeatureLayer
- feature layer of the featurefeatureId
- feature identifier- Returns:
- parent string
- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteFeatureParentRelationship
public void deleteFeatureParentRelationship(NFEFeature feature) throws NFEIOException
Deletes the feature parent relationship where the feature is parent or child.- Parameters:
feature
- feature- Throws:
NFEIOException
- if an NFE error occurs.
-
updateFeatureHierarchy
public void updateFeatureHierarchy(NFEFeature feature) throws NFEIOException
Updates the feature hierarchy in the feature and hierarchy tables.- Parameters:
feature
- feature- Throws:
NFEIOException
- if an NFE error occurs.
-
getChildFeatures
public java.util.List<NFEFeature> getChildFeatures(NFEModel nfeModel, NFEFeature nfeFeature) throws NFEIOException
Returns the children of the specified feature.- Parameters:
nfeModel
- modelnfeFeature
- feature- Returns:
- children of the feature
- Throws:
NFEIOException
- if an NFE error occurs.
-
findFeaturesIds
public java.util.List<java.lang.Long> findFeaturesIds(NFEModelMetadata nfeModelMetadata, NFESearchParams searchParams) throws NFEIOException
Searches features. In the object searchParams the featureLayerId is mandatory, the parameters featureClassId, featureId and conditionString are optional. The conditionString parameter will be added to the where clause of the search query on the feature table.- Parameters:
nfeModelMetadata
- model metadatasearchParams
- search parameters- Returns:
- identifiers of the resulting features
- Throws:
NFEIOException
- if an NFE error occurs.
-
deleteDanglingFeatureElements
public void deleteDanglingFeatureElements(NFEFeatureLayerMetadata metadata) throws NFEIOException
Deletes feature elements that refer to features that do not exist.- Parameters:
metadata
- feature layer metadata- Throws:
NFEIOException
- if an NFE error occurs.
-
updateAttributeForFeatures
public void updateAttributeForFeatures(NFEModelMetadata nfeModelMetadata, NFEFeatureLayer nfeFeatureLayer, java.lang.Long featureClassId, java.lang.String attributeName, java.lang.String newValue, java.lang.String oldValue) throws NFEIOException
Updates the attributes for the features having the value oldValue and belonging to the specified feature class to newValue.- Parameters:
nfeModelMetadata
- model metadatanfeFeatureLayer
- feature layerfeatureClassId
- feature class identifierattributeName
- attribute namenewValue
- new valueoldValue
- old value- Throws:
NFEIOException
- if an NFE error occurs.
-
-