Class Conditionable<T extends Conditionable<T>>

  • Type Parameters:
    T - The type which allows setting conditions
    All Implemented Interfaces:
    QueryPart
    Direct Known Subclasses:
    Condition, ConnectBy, Having, Join, NestedCondition, StartWith, Where

    public abstract class Conditionable<T extends Conditionable<T>>
    extends QueryPartImpl<T>
    Abstract base class for condition like statements, generic to allow multiple origins, for example from WHERE, JOIN etc.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Conditionable.Operator  
    • 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, 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 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
      • 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()
      • Conditionable

        protected Conditionable​(QueryPart parent)
    • Method Detail

      • values

        public T values​(ValueHolder values)
        Set the comparing values
        Parameters:
        values - The comparing values
        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
      • 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