Class TQAssocBean<T,R,QB>

Type Parameters:
T - the entity bean type (normal entity bean type e.g. Customer)
R - the specific root query bean type (e.g. QCustomer)
QB - the query bean type
All Implemented Interfaces:
io.ebean.Query.Property<Object>

public abstract class TQAssocBean<T,R,QB> extends TQAssoc<T,R>
Base type for associated beans that are not embeddable.
  • Field Summary

    Fields inherited from class io.ebean.typequery.TQProperty

    _name, _root
  • Constructor Summary

    Constructors
    Constructor
    Description
    TQAssocBean(String name, R root)
    Construct with a property name and root instance.
    TQAssocBean(String name, R root, String prefix)
    Construct with additional path prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
    final R
    Eagerly fetch this association fetching all the properties.
    final R
    fetch(io.ebean.FetchConfig config, TQProperty<QB,?>... properties)
    Fetch this association with config for the type of fetch and the specified properties.
    final R
    fetch(io.ebean.FetchGroup<T> nestedGroup)
    Fetch using the nested FetchGroup.
    final R
    fetch(TQProperty<QB,?>... properties)
    Eagerly fetch this association loading the specified properties.
    final R
    fetch(String properties)
    Eagerly fetch this association with the properties specified.
    final R
    Eagerly fetch this association using L2 bean cache.
    final R
    fetchCache(io.ebean.FetchGroup<T> nestedGroup)
    Fetch cache using the nested FetchGroup.
    final R
    fetchCache(TQProperty<QB,?>... properties)
    Eagerly fetch this association using L2 cache.
    final R
    fetchCache(String properties)
    Eagerly fetch this association using L2 cache with the properties specified.
    final R
    Use lazy loading for fetching this association.
    final R
    fetchLazy(TQProperty<QB,?>... properties)
    Use lazy loading for this association loading the specified properties.
    final R
    Eagerly fetch this association using a "query join".
    final R
    fetchQuery(io.ebean.FetchGroup<T> nestedGroup)
    Fetch query using the nested FetchGroup.
    final R
    fetchQuery(TQProperty<QB,?>... properties)
    Eagerly fetch this association using a 'query join' loading the specified properties.
    final R
    fetchQuery(String properties)
    Eagerly fetch this association using a "query join" with the properties specified.
    final R
    filterMany(io.ebean.ExpressionList<T> filter)
    Apply a filter when fetching these beans.
    final R
    filterManyRaw(String rawExpressions, Object... params)
    Add filter expressions for the many path.
    final R
    Is empty for a collection property.
    final R
    Is not empty for a collection property.

    Methods inherited from class io.ebean.typequery.TQAssoc

    eq, eqIfPresent, equalTo, in, in, inOrEmpty, ne, notEqualTo, notIn, notIn

    Methods inherited from class io.ebean.typequery.TQProperty

    expr, isNotNull, isNull, propertyName, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TQAssocBean

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

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

    • fetch

      public final R fetch()
      Eagerly fetch this association fetching all the properties.
    • fetchQuery

      public final R fetchQuery()
      Eagerly fetch this association using a "query join".
    • fetchCache

      public final R fetchCache()
      Eagerly fetch this association using L2 bean cache. Cache misses are populated via fetchQuery().
    • fetchLazy

      public final R fetchLazy()
      Use lazy loading for fetching this association.
    • fetch

      public final R fetch(String properties)
      Eagerly fetch this association with the properties specified.
    • fetchQuery

      public final R fetchQuery(String properties)
      Eagerly fetch this association using a "query join" with the properties specified.
    • fetchCache

      public final R fetchCache(String properties)
      Eagerly fetch this association using L2 cache with the properties specified. Cache misses are populated via fetchQuery().
    • fetch

      @SafeVarargs public final R fetch(TQProperty<QB,?>... properties)
      Eagerly fetch this association loading the specified properties.
    • fetch

      @SafeVarargs public final R fetch(io.ebean.FetchConfig config, TQProperty<QB,?>... properties)
      Fetch this association with config for the type of fetch and the specified properties.
      Parameters:
      config - Fetch configuration to define the type of fetch to use
      properties - The properties to fetch
    • fetchQuery

      @SafeVarargs public final R fetchQuery(TQProperty<QB,?>... properties)
      Eagerly fetch this association using a 'query join' loading the specified properties.
    • fetchCache

      @SafeVarargs public final R fetchCache(TQProperty<QB,?>... properties)
      Eagerly fetch this association using L2 cache.
    • fetchLazy

      @SafeVarargs public final R fetchLazy(TQProperty<QB,?>... properties)
      Use lazy loading for this association loading the specified properties.
    • fetch

      public final R fetch(io.ebean.FetchGroup<T> nestedGroup)
      Fetch using the nested FetchGroup.
    • fetchQuery

      public final R fetchQuery(io.ebean.FetchGroup<T> nestedGroup)
      Fetch query using the nested FetchGroup.
    • fetchCache

      public final R fetchCache(io.ebean.FetchGroup<T> nestedGroup)
      Fetch cache using the nested FetchGroup.
    • filterMany

      public final R filterMany(io.ebean.ExpressionList<T> filter)
      Apply a filter when fetching these beans.
    • filterManyRaw

      public final R filterManyRaw(String rawExpressions, Object... params)
      Add filter expressions for the many path. The expressions can include SQL functions if desired and the property names are translated to column names.

      The expressions can contain placeholders for bind values using ? or ?1 style.

      
      
           new QCustomer()
             .name.startsWith("Shrek")
             .contacts.filterManyRaw("status = ? and firstName like ?", Contact.Status.NEW, "Rob%")
             .findList();
      
       
      Parameters:
      rawExpressions - The raw expressions which can include ? and ?1 style bind parameter placeholders
      params - The parameter values to bind
    • isEmpty

      public final R isEmpty()
      Is empty for a collection property.

      This effectively adds a not exists sub-query on the collection property.

      This expression only works on OneToMany and ManyToMany properties.

    • isNotEmpty

      public final R isNotEmpty()
      Is not empty for a collection property.

      This effectively adds an exists sub-query on the collection property.

      This expression only works on OneToMany and ManyToMany properties.