Package jakarta.nosql

Interface QueryMapper.MapperNameCondition

All Known Subinterfaces:
QueryMapper.MapperNotCondition
Enclosing interface:
QueryMapper

public static interface QueryMapper.MapperNameCondition
Represents a condition based on a column name.
  • Method Details

    • eq

      <T> QueryMapper.MapperWhere eq(T value)
      Creates a condition where the specified column value equals the given value. Example:
      
       template.select(User.class)
               .where("username").eq("alice")
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      value - the value for the comparison
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • gt

      <T> QueryMapper.MapperWhere gt(T value)
      Creates a condition where the specified column value is greater than the given value. Example:
      
       template.select(Product.class)
               .where("price").gt(50)
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      value - the value for the comparison
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • gte

      <T> QueryMapper.MapperWhere gte(T value)
      Creates a condition where the specified column value is greater than or equal to the given value.
      
       template.select(Product.class)
               .where("stock").gte(10)
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      value - the value for the comparison
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • lt

      <T> QueryMapper.MapperWhere lt(T value)
      Creates a condition where the specified column value is less than the given value.
      
       template.select(Order.class)
               .where("totalAmount").lt(500)
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      value - the value for the comparison
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • lte

      <T> QueryMapper.MapperWhere lte(T value)
      Creates a condition where the specified column value is less than or equal to the given value.
      
       template.select(Customer.class)
               .where("age").lte(30)
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      value - the value for the comparison
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • like

      Creates a condition where the specified column value matches the provided pattern.
      
       template.select(Book.class)
               .where("title").like("Java")
               .result();
       
      Parameters:
      value - the pattern value to match
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if value is null
    • contains

      Creates a condition where the specified column contains the given substring. This is useful for filtering results where a column includes the given text fragment anywhere within its value.
      Parameters:
      value - the substring to search for within the column
      Returns:
      the QueryMapper.MapperWhere instance for further condition chaining
      Throws:
      NullPointerException - if value is null
      
       template.select(Book.class)
               .where("title").contains("Java")
               .result();
       
    • startsWith

      QueryMapper.MapperWhere startsWith(String value)
      Creates a condition where the specified column starts with the given prefix. This is useful for filtering results where a column begins with a specific value.
      Parameters:
      value - the prefix to match at the beginning of the column
      Returns:
      the QueryMapper.MapperWhere instance for further condition chaining
      Throws:
      NullPointerException - if value is null

      Example:

      
       template.select(User.class)
               .where("username").startsWith("admin")
               .result();
       
    • endsWith

      Creates a condition where the specified column ends with the given suffix. This is useful for filtering results where a column ends with a specific value.
      Parameters:
      value - the suffix to match at the end of the column
      Returns:
      the QueryMapper.MapperWhere instance for further condition chaining
      Throws:
      NullPointerException - if value is null

      Example:

      
       template.select(Document.class)
               .where("filename").endsWith(".pdf")
               .result();
       
    • between

      <T> QueryMapper.MapperWhere between(T valueA, T valueB)
      Creates a condition where the specified column value is between the two provided bounds.
      
       template.select(Product.class)
               .where("price").between(10, 100)
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      valueA - the lower bound
      valueB - the upper bound
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if either valueA or valueB is null
    • in

      <T> QueryMapper.MapperWhere in(Iterable<T> values)
      Creates a condition where the specified column value exists within the given collection.
      
       template.select(Product.class)
               .where("category").in(List.of("book", "electronics"))
               .result();
       
      Type Parameters:
      T - the type of the value to compare with the column value
      Parameters:
      values - the collection of values to match
      Returns:
      the QueryMapper.MapperWhere instance for chaining
      Throws:
      NullPointerException - if values is null
    • not

      Creates a negated condition for the current column, allowing inverse logic.
      
       template.select(User.class)
               .where("active").not().eq(true)
               .result();
       
      Returns:
      the QueryMapper.MapperNotCondition to continue building a negated expression