Class QueryCondition

java.lang.Object
com.ptsmods.mysqlw.query.QueryCondition
Direct Known Subclasses:
QueryConditions

public abstract class QueryCondition extends Object
A condition a query must meet to affect or return rows.
  • Constructor Details

    • QueryCondition

      public QueryCondition()
  • Method Details

    • func

      public static QueryConditions func(QueryFunction function)
      Parameters:
      function - The function to check
      Returns:
      A QueryCondition that checks the given function
    • equals

      public static QueryConditions equals(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition comparing a column against a value
    • varEquals

      public static QueryConditions varEquals(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition comparing two variables
    • notEquals

      public static QueryConditions notEquals(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column does not equal a value
    • varNotEquals

      public static QueryConditions varNotEquals(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition that checks if two variables are not equal
    • greater

      public static QueryConditions greater(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column is greater than the given value
    • varGreater

      public static QueryConditions varGreater(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition that checks if var1 is greater than var2
    • greaterEqual

      public static QueryConditions greaterEqual(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column is greater than or equal to the given value
    • varGreaterEqual

      public static QueryConditions varGreaterEqual(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition that checks if var1 is greater than or equal to var2
    • less

      public static QueryConditions less(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column is less than the given value
    • varLess

      public static QueryConditions varLess(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition that checks if var1 is less than var2
    • lessEqual

      public static QueryConditions lessEqual(String key, Object value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column is less than or equal to the given value
    • varLessEqual

      public static QueryConditions varLessEqual(String var1, String var2)
      Parameters:
      var1 - The first variable
      var2 - The second variable
      Returns:
      A QueryCondition that checks if var1 is less than or equal to var2
    • like

      public static QueryConditions like(String key, String value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column is like the given value
    • match

      public static QueryConditions match(String key, String value)
      Parameters:
      key - The name of the column to compare
      value - The value to compare to
      Returns:
      A QueryCondition that checks if a column matches the given value
    • in

      public static QueryConditions in(String key, Object[] objects)
      Parameters:
      key - The name of the column to compare
      objects - The objects to check
      Returns:
      A QueryCondition that checks if a column is in the given list
    • notIn

      public static QueryConditions notIn(String key, Object[] objects)
      Parameters:
      key - The name of the column to compare
      objects - The objects to check
      Returns:
      A QueryCondition that checks if a column is not in the given list
    • bool

      public static QueryConditions bool(String arg)
      Parameters:
      arg - The name of the argument to check
      Returns:
      A QueryCondition that checks the value of a column or variable
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object