Examples of addCondition()


Examples of org.drools.rule.Rule.addCondition()

            public String toString()
            {
                return "f2.getValue() != -1";
            }
        };
        calculateRule.addCondition( conditionCalculateD );

        // <java:condition>f3.getValue() == -1</java:condition>
        final Condition conditionCalculateE = new Condition( )
        {
            public boolean isAllowed(Tuple tuple)
View Full Code Here

Examples of org.drools.rule.Rule.addCondition()

            public String toString()
            {
                return "f3.getValue() == -1";
            }
        };
        calculateRule.addCondition( conditionCalculateE );

        // <java:consequence>
        // f3.setValue( f1.getValue() + f2.getValue() );
        // System.err.println( f3.getSequence() + " == " + f3.getValue() );
        // drools.modifyObject( f3 );
View Full Code Here

Examples of org.drools.rule.Rule.addCondition()

        Rule rule = new Rule( "test-rule 1" );
        Declaration paramDecl = rule.addParameterDeclaration( "paramVar", new MockObjectType( true ) );
        //add consequence
        rule.setConsequence( new org.drools.spi.InstrumentedConsequence( ) );
        //add condition
        rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );

        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        ParameterNode node = new ParameterNode( null, paramDecl );
View Full Code Here

Examples of org.drools.template.model.Rule.addCondition()

        } else {
            firstRule = null;
            rule.setName( "rule_" + row + "_" + column );
        }
        rule.setAgendaGroup( this._currentAgendaGroup );
        rule.addCondition( this._currentPrecondition );
        rule.addCondition( _currentVerticalCondition );
        rule.addCondition( (Condition) _horizontalConditions.get( column - (ruleTableColumn + 1) ) );
        rule.addConsequence( consequence );
    }
View Full Code Here

Examples of org.eigenbase.rex.RexProgramBuilder.addCondition()

          {
          // Build a program that has a condition (a possibly complex expression)
          // but projects all inputs.
          final RexProgramBuilder builder = new RexProgramBuilder( previous.getOutputRowType(), rexBuilder );
          builder.addIdentity();
          builder.addCondition( program.gatherExpr( program.getCondition() ) );
          previous = builder.getProgram();
          list.add( Pair.of( Op.FILTER, previous ) );

          // Remove condition from the remaining program.
          final RexProgramBuilder builder2 = RexProgramBuilder.forProgram( program, rexBuilder, false );
View Full Code Here

Examples of org.exolab.castor.persist.spi.QueryExpression.addCondition()

            // Create "SELECT seq_val FROM seq_table WHERE seq_key='table'"
            // with database-dependent keyword for lock
            // Note: Some databases (InstantDB, HypersonicSQL) don't support such locks.
            QueryExpression query = _factory.getQueryExpression();
            query.addColumn(_seqTable, _seqValue);
            query.addCondition(_seqTable, _seqKey, QueryExpression.OP_EQUALS, JDBCSyntax.PARAMETER);
            String lockSQL = query.getStatement(true);
           
            // For the case that "SELECT FOR UPDATE" is not supported, perform dirty checking
            String updateSQL = "UPDATE " +  _seqTable
                + " SET " + _seqValue + "=" + JDBCSyntax.PARAMETER
View Full Code Here

Examples of org.hibernate.engine.JoinSequence.addCondition()

      join.addJoin( ( AssociationType ) persister.getElementType(),
          fromElement.getTableAlias(),
          JoinFragment.INNER_JOIN,
          persister.getElementColumnNames( fkTableAlias ) );
    }
    join.addCondition( fkTableAlias, keyColumnNames, " = ?" );
    fromElement.setJoinSequence( join );
    fromElement.setFilter( true );
    if ( log.isDebugEnabled() ) {
      log.debug( "createFromFilterElement() : processed filter FROM element." );
    }
View Full Code Here

Examples of org.hibernate.engine.internal.JoinSequence.addCondition()

          fromElement.getTableAlias(),
          JoinType.INNER_JOIN,
          persister.getElementColumnNames( fkTableAlias )
      );
    }
    join.addCondition( fkTableAlias, keyColumnNames, " = ?" );
    fromElement.setJoinSequence( join );
    fromElement.setFilter( true );
    LOG.debug( "createFromFilterElement() : processed filter FROM element." );
    return fromElement;
  }
View Full Code Here

Examples of org.hibernate.sql.DisjunctionFragment.addCondition()

      else {
        // for batching, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )"
        restrictions.append( '(' );
        DisjunctionFragment df = new DisjunctionFragment();
        for ( int i=0; i<batchSize; i++ ) {
          df.addCondition( keyRestrictionFragment );
        }
        restrictions.append( df.toFragmentString() );
        restrictions.append( ')' );
      }
      select.appendRestrictions( restrictions.toString() );
View Full Code Here

Examples of org.hibernate.sql.QueryJoinFragment.addCondition()

      joinFragment.addCrossJoin( rootJoinable.getTableName(), rootAlias );
      String filterCondition = rootJoinable.filterFragment( rootAlias, enabledFilters );
      // JoinProcessor needs to know if the where clause fragment came from a dynamic filter or not so it
      // can put the where clause fragment in the right place in the SQL AST.   'hasFilterCondition' keeps track
      // of that fact.
      joinFragment.setHasFilterCondition( joinFragment.addCondition( filterCondition ) );
      if (includeExtraJoins) { //TODO: not quite sure about the full implications of this!
        addExtraJoins( joinFragment, rootAlias, rootJoinable, true );
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.