Class Conditionable<T extends Conditionable<T>>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T and()
      Connect the previous and next condition with the AND operator
      ConditionPart<T> col​(java.lang.String name)
      Use a column as constraint
      T col​(java.lang.String name, CompareOperator operator, ConditionValueType type, java.lang.Object... values)
      Use a column as constraint and set the comparative element
      T col​(java.lang.String name, java.lang.Object value)
      Compare a column to a value
      T col​(java.lang.String name, java.lang.Object... values)
      Compare a column to multiple values
      T col​(java.lang.String name, java.lang.String operator, ConditionValueType type, java.lang.Object... values)
      Use a column as constraint and set the comparative element
      T colsEq​(java.lang.String name1, java.lang.String name2)
      Compare a column to another column
      T group​(Condition group)
      Include a subgroup in the condition
      NestedCondition<T> groupStart()
      Start a nested condition group
      T or()
      Connect the previous and next condition with the OR operator
      java.lang.String string​(QueryOptions options)
      Transforms this statement into an SQL string
      T values​(ValueHolder values)
      Set the comparing values
      T values​(ValueHolder values, java.lang.String columnPrefix)
      Set the comparing values with prefix
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPart

        string
    • Constructor Detail

      • Conditionable

        public Conditionable()
        Creates a new empty conditionable
    • Method Detail

      • values

        public T values​(ValueHolder values)
        Set the comparing values
        Parameters:
        values - The comparing values
        Returns:
        This instance
      • values

        public T values​(ValueHolder values,
                        java.lang.String columnPrefix)
        Set the comparing values with prefix
        Parameters:
        values - The comparing values
        columnPrefix - The column prefix for each constraint
        Returns:
        This instance
      • col

        public T col​(java.lang.String name,
                     CompareOperator operator,
                     ConditionValueType type,
                     java.lang.Object... values)
        Use a column as constraint and set the comparative element
        Parameters:
        name - The column name
        operator - The comarator operator
        type - The type of the value
        values - The value to compare to
        Returns:
        This instance
      • col

        public T col​(java.lang.String name,
                     java.lang.String operator,
                     ConditionValueType type,
                     java.lang.Object... values)
        Use a column as constraint and set the comparative element
        Parameters:
        name - The column name
        operator - The comarator operator as string
        type - The type of the value
        values - The value to compare to
        Returns:
        This instance
      • col

        public ConditionPart<T> col​(java.lang.String name)
        Use a column as constraint
        Parameters:
        name - The column name
        Returns:
        The value instance to set the compare value
      • col

        public T col​(java.lang.String name,
                     java.lang.Object value)
        Compare a column to a value
        Parameters:
        name - The column name
        value - The comparing value
        Returns:
        This instance
      • colsEq

        public T colsEq​(java.lang.String name1,
                        java.lang.String name2)
        Compare a column to another column
        Parameters:
        name1 - The first column name
        name2 - The second column name
        Returns:
        This instance
      • col

        public T col​(java.lang.String name,
                     java.lang.Object... values)
        Compare a column to multiple values
        Parameters:
        name - The column name
        values - The comparing values
        Returns:
        This instance
      • group

        public T group​(Condition group)
        Include a subgroup in the condition
        Parameters:
        group - The subgroup
        Returns:
        This instance
      • groupStart

        public NestedCondition<T> groupStart()
        Start a nested condition group
        Returns:
        The new nested condition group
      • and

        public T and()
        Connect the previous and next condition with the AND operator
        Returns:
        This instance
      • or

        public T or()
        Connect the previous and next condition with the OR operator
        Returns:
        This instance
      • string

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