Class ConditionPart<T extends Conditionable<T>>

  • Type Parameters:
    T - the type of the conditionable to return to
    All Implemented Interfaces:
    QueryPart

    public class ConditionPart<T extends Conditionable<T>>
    extends java.lang.Object
    implements QueryPart
    The ConditionPart is a part of the conditionable expression. It marks the start of a new condition and provides methods to configure it and return to the conditionable in a fluid style.
    • Constructor Detail

      • ConditionPart

        protected ConditionPart​(Conditionable<T> conditionable,
                                java.lang.String name)
    • Method Detail

      • not

        public ConditionPart<T> not()
        The NOT operator
        Returns:
        The value instance to set the compare value
      • eq

        public ConditionValue<T> eq()
        The EQUALS operator
        Returns:
        The value instance to set the compare value
      • eq

        public T eq​(java.lang.Object value)
        The EQUALS operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • eqCol

        public T eqCol​(java.lang.String column)
        Set a column to be constrained
        Parameters:
        column - The column name
        Returns:
        This instance
      • eqExpr

        public T eqExpr​(java.lang.String expr,
                        java.lang.Object... values)
        Set an expression to be used as condition
        Parameters:
        expr - The condition expression
        values - Additional values that are passed to the PreparedStatement. These values are ignored if the target is not a PreparedQuery.
        Returns:
        This instance
      • eqExpr

        public T eqExpr​(Expression expression)
        Set an expression to be used as condition
        Parameters:
        expression - The condition expression
        Returns:
        This instance
      • notEq

        public ConditionValue<T> notEq()
        The NOT EQUALS operator
        Returns:
        The value instance to set the compare value
      • notEq

        public T notEq​(java.lang.Object value)
        The NOT EQUALS operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • ge

        public ConditionValue<T> ge()
        The GREATER EQUALS operator
        Returns:
        The value instance to set the compare value
      • ge

        public T ge​(java.lang.Object value)
        The GREATER EQUALS operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • gt

        public ConditionValue<T> gt()
        The GREATER THAN operator
        Returns:
        The value instance to set the compare value
      • gt

        public T gt​(java.lang.Object value)
        The GREATER THAN operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • le

        public ConditionValue<T> le()
        The LESSER EQUALS operator
        Returns:
        The value instance to set the compare value
      • le

        public T le​(java.lang.Object value)
        The LESSER EQUALS operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • lt

        public ConditionValue<T> lt()
        The LESSER THAN operator
        Returns:
        The value instance to set the compare value
      • lt

        public T lt​(java.lang.Object value)
        The LESSER THAN operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • like

        public ConditionValue<T> like()
        The LIKE operator
        Returns:
        The value instance to set the compare value
      • like

        public T like​(java.lang.Object value)
        The LIKE operator. Only accepts values
        Parameters:
        value - The value to compare to
        Returns:
        The previous instance
      • in

        public ConditionValue<T> in()
        The IN operator
        Returns:
        The value instance to set the compare values
      • in

        public T in​(java.lang.Object... values)
        The IN operator. Only accepts values
        Parameters:
        values - The values to compare to
        Returns:
        The previous instance
      • in

        public T in​(java.lang.Iterable<java.lang.Object> values)
        The IN operator. Only accepts values
        Parameters:
        values - The values to compare to
        Returns:
        The previous instance
      • between

        public ConditionBiValue<T> between()
        The BETWEEN operator
        Returns:
        The value instance to set the compare values
      • between

        public T between​(java.lang.Object value1,
                         java.lang.Object value2)
        The BETWEEN operator
        Parameters:
        value1 - The first value
        value2 - The second value
        Returns:
        The previous instance
      • isNull

        public T isNull()
        The IS NULL operator
        Returns:
        The previous instance
      • string

        public java.lang.String string​(QueryOptions options)
        Description copied from interface: QueryPart
        Transforms this statement into an SQL string
        Specified by:
        string in interface QueryPart
        Parameters:
        options - The QueryOptions to apply for transformation
        Returns:
        The created SQL string