Class RuleDAO


  • public class RuleDAO
    extends AbstractDAO
    The RuleDAO data access object provides methods to load, create and manage the NFE rules. It is not recommended to use the data access objects methods, instead use the NFE services.
    • Constructor Detail

      • RuleDAO

        public RuleDAO​(java.sql.Connection conn,
                       NFEModel model)
        Creates a RuleDAO with the specified connection and model.
        Parameters:
        conn - connection
        model - model
    • Method Detail

      • saveRules

        public void saveRules​(java.util.Collection<? extends NFEConnectivityRule> rules)
                       throws NFEIOException
        Persists the new rules in the tables LINE_LINE_RULE_[model_id] and LINE_POINT_RULE_[model_id].
        Parameters:
        rules - new rules to persist
        Throws:
        NFEIOException - if an NFE error occurs.
      • updateRules

        public void updateRules​(java.util.Collection<? extends NFEConnectivityRule> rules)
                         throws NFEIOException
        Updates the specified rules in the tables LINE_LINE_RULE_[model_id] and LINE_POINT_RULE_[model_id].
        Parameters:
        rules - rules to update
        Throws:
        NFEIOException - if an NFE error occurs.
      • deleteRules

        public void deleteRules​(java.util.Collection<? extends NFEConnectivityRule> rules)
                         throws NFEIOException
        Deletes the specified rules from the tables LINE_LINE_RULE_[model_id] and LINE_POINT_RULE_[model_id].
        Parameters:
        rules - rules to delete
        Throws:
        NFEIOException - if an NFE error occurs.
      • getLinePointRules

        public java.util.List<NFELinePointRule> getLinePointRules()
                                                           throws NFEIOException
        Returns the model's line point rules from the table LINE_POINT_RULE_[model_id].
        Returns:
        the model's line point rules
        Throws:
        NFEIOException - if an NFE error occurs.
      • getLineLineRules

        public java.util.List<NFELineLineRule> getLineLineRules​(java.util.Collection<NFELinePointRule> linePointRules)
                                                         throws NFEIOException
        Returns the model's line line rules from the table LINE_LINE_RULE_[model_id].
        Parameters:
        linePointRules - the model line point rules. Those rules will be set to the line line rules.
        Returns:
        the model's line line rules
        Throws:
        NFEIOException - if an NFE error occurs.
      • hasAnyRuleInstanceAssociated

        public boolean hasAnyRuleInstanceAssociated​(NFEConnectivityRule rule)
                                             throws NFEIOException
        Returns true if any rule instance is related to the specified rule in the table RULE_INSTANCE_[model_id], false otherwise.
        Parameters:
        rule - rule
        Returns:
        true if any rule instance is related to the specified rule in the table RULE_INSTANCE_[model_id], false otherwise
        Throws:
        NFEIOException - if an NFE error occurs.
      • getCardinalityRules

        public java.util.List<NFECardinalityRule> getCardinalityRules()
                                                               throws NFEIOException
        Returns the model's cardinality rules from the table POINT_CARD_RULE_[model_id].
        Returns:
        the model's cardinality rules from the table POINT_CARD_RULE_[model_id]
        Throws:
        NFEIOException - if an NFE error occurs.
      • deleteDanglingRuleFeatureRel

        public void deleteDanglingRuleFeatureRel​(NFEFeatureLayerMetadata metadata)
                                          throws NFEIOException
        Deletes the rules elements that are not referencing existing features from the specified feature layer.
        Parameters:
        metadata - feature layer metadata
        Throws:
        NFEIOException - if an NFE error occurs.
      • deleteRuleInstanceRelations

        public void deleteRuleInstanceRelations​(java.util.Collection<NFERuleInstanceRelation> ruleInstanceRelations)
                                         throws NFEIOException
        Deletes the specified feature rule relations from the tables FT_RULE_REL_[model_id].
        Parameters:
        ruleInstanceRelations - feature rule relations to delete
        Throws:
        NFEIOException - if an NFE error occurs.
      • saveRuleInstancesRelations

        public void saveRuleInstancesRelations​(java.util.Collection<NFERuleInstanceRelation> ruleInstanceRelations)
                                        throws NFEIOException
        Persists the new feature rule relations in the table FT_RULE_REL_[model_id].
        Parameters:
        ruleInstanceRelations - new feature rule relations to persist
        Throws:
        NFEIOException - if an NFE error occurs.
      • saveRuleInstances

        public void saveRuleInstances​(java.util.Collection<NFERuleInstance> ruleInstances)
                               throws NFEIOException
        Persists the new rule instances in the table RULE_INSTANCE_[model_id].
        Parameters:
        ruleInstances - new rule instances to persist
        Throws:
        NFEIOException - if an NFE error occurs.
      • deleteRuleInstances

        public void deleteRuleInstances​(java.util.Collection<NFERuleInstance> ruleInstances)
                                 throws NFEIOException
        Deletes the specified rule instances from the tables RULE_INSTANCE_[model_id].
        Parameters:
        ruleInstances - rule instances to delete
        Throws:
        NFEIOException - if an NFE error occurs.