private String getSQLCondition(Function atom, AliasIndex index) {
		Predicate functionSymbol = atom.getFunctionSymbol();
		if (operations.containsKey(functionSymbol)) {
			String expressionFormat = operations.get(functionSymbol);
			if (functionSymbol.getArity() == 1) {
				// For unary boolean operators, e.g., NOT, IS NULL, IS NOT NULL.
				Term term = atom.getTerm(0);
				final String arg;
				if (functionSymbol == ExpressionOperation.NOT) {
					arg = (term instanceof Function && ((Function) term).isDataTypeFunction())
							? effectiveBooleanValue(term, index)
							: getSQLString(term, index, false);
				}
				else {
					arg = getSQLString(term, index, false);
				}
				return String.format(expressionFormat, arg);
			}
			else if (functionSymbol.getArity() == 2) {
				// For binary boolean operators, e.g., AND, OR, EQ, GT, LT, etc.
				String left = getSQLString(atom.getTerm(0), index, true);
				String right = getSQLString(atom.getTerm(1), index, true);
				return String.format(inBrackets(expressionFormat), left, right);
			}
		}
		else if (functionSymbol == ExpressionOperation.IS_TRUE) {
			return effectiveBooleanValue(atom.getTerm(0), index);
		}
		else if (functionSymbol == ExpressionOperation.REGEX) {
			boolean caseinSensitive = false, multiLine = false, dotAllMode = false;
			if (atom.getArity() == 3) {
				String options = atom.getTerm(2).toString();
				caseinSensitive = options.contains("i");
				multiLine = options.contains("m");
				dotAllMode = options.contains("s");
			}
			String column = getSQLString(atom.getTerm(0), index, false);
			String pattern = getSQLString(atom.getTerm(1), index, false);
			return sqladapter.sqlRegex(column, pattern, caseinSensitive, multiLine, dotAllMode);
		}

		throw new RuntimeException("The builtin function " + functionSymbol + " is not supported yet!");
	}
private String getSQLCondition ( Function atom , AliasIndex index ) { Predicate functionSymbol = atom . getFunctionSymbol ( ) ; if ( operations . containsKey ( functionSymbol ) ) { String expressionFormat = operations . get ( functionSymbol ) ; if ( functionSymbol . getArity ( ) == 1 ) { Term term = atom . getTerm ( 0 ) ; final String arg ; if ( functionSymbol == ExpressionOperation . NOT ) { arg = ( term instanceof Function && ( ( Function ) term ) . isDataTypeFunction ( ) ) ? effectiveBooleanValue ( term , index ) : getSQLString ( term , index , false ) ; } else { arg = getSQLString ( term , index , false ) ; } return String . format ( expressionFormat , arg ) ; } else if ( functionSymbol . getArity ( ) == 2 ) { String left = getSQLString ( atom . getTerm ( 0 ) , index , true ) ; String right = getSQLString ( atom . getTerm ( 1 ) , index , true ) ; return String . format ( inBrackets ( expressionFormat ) , left , right ) ; } } else if ( functionSymbol == ExpressionOperation . IS_TRUE ) { return effectiveBooleanValue ( atom . getTerm ( 0 ) , index ) ; } else if ( functionSymbol == ExpressionOperation . REGEX ) { boolean caseinSensitive = false , multiLine = false , dotAllMode = false ; if ( atom . getArity ( ) == 3 ) { String options = atom . getTerm ( 2 ) . toString ( ) ; caseinSensitive = options . contains ( "i" ) ; multiLine = options . contains ( "m" ) ; dotAllMode = options . contains ( "s" ) ; } String column = getSQLString ( atom . getTerm ( 0 ) , index , false ) ; String pattern = getSQLString ( atom . getTerm ( 1 ) , index , false ) ; return sqladapter . sqlRegex ( column , pattern , caseinSensitive , multiLine , dotAllMode ) ; } throw new RuntimeException ( "The builtin function " + functionSymbol + " is not supported yet!" ) ; }
Returns the SQL for an atom representing an SQL condition (booleans).