Class PString<R>

Type Parameters:
R - the root query bean type
All Implemented Interfaces:
io.ebean.Query.Property<String>

public final class PString<R> extends PBaseComparable<R,String>
String property.
  • Constructor Details

    • PString

      public PString(String name, R root)
      Construct with a property name and root instance.
      Parameters:
      name - property name
      root - the root query bean instance
    • PString

      public PString(String name, R root, String prefix)
      Construct with additional path prefix.
  • Method Details

    • eqIfNotBlank

      public R eqIfNotBlank(@Nullable String value)
      Is equal to if the value is non-null and not blank, otherwise no expression is added to the query.

      This is like eqIfPresent() but additionally treats an empty or whitespace-only value as "not present". When present, the value is trimmed before being used in the equal to expression.

      This is a helper for building queries in fluid style where a String predicate is effectively optional, avoiding a separate if block and trimToNull() style helper.

        List<Customer> customers = new QCustomer()
          .name.eqIfNotBlank(nameFilter)
          .status.eqIfPresent(statusFilter)
          .findList();
      
      Parameters:
      value - the value which can be null or blank
      Returns:
      the root query bean instance
    • ieq

      public R ieq(String value)
      Case insensitive is equal to.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • iequalTo

      public R iequalTo(String value)
      Case insensitive is equal to.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • like

      public R like(String value)
      Like - include '%' and '_' placeholders as necessary.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • likeIfPresent

      public R likeIfPresent(@Nullable String value)
      Is like if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance
    • startsWith

      public R startsWith(String value)
      Starts with - uses a like with '%' wildcard added to the end.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • startsWithIfPresent

      public R startsWithIfPresent(@Nullable String value)
      Is starts with if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance
    • endsWith

      public R endsWith(String value)
      Ends with - uses a like with '%' wildcard added to the beginning.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • contains

      public R contains(String value)
      Contains - uses a like with '%' wildcard added to the beginning and end.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • containsIfPresent

      public R containsIfPresent(@Nullable String value)
      Is contains if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance
    • ilike

      public R ilike(String value)
      Case insensitive like.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • ilikeIfPresent

      public R ilikeIfPresent(@Nullable String value)
      Is case-insensitive like if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance
    • istartsWith

      public R istartsWith(String value)
      Case insensitive starts with.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • istartsWithIfPresent

      public R istartsWithIfPresent(@Nullable String value)
      Is case-insensitive starts with if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance
    • iendsWith

      public R iendsWith(String value)
      Case insensitive ends with.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • icontains

      public R icontains(String value)
      Case insensitive contains.
      Parameters:
      value - the equal to bind value
      Returns:
      the root query bean instance
    • icontainsIfPresent

      public R icontainsIfPresent(@Nullable String value)
      Is case-insensitive contains if value is non-null and otherwise no expression is added to the query.
      Parameters:
      value - the value which can be null
      Returns:
      the root query bean instance