Package io.ebean.typequery
Class TQAssocBean<T,R>
- java.lang.Object
-
- io.ebean.typequery.TQProperty<R>
-
- io.ebean.typequery.TQAssocBean<T,R>
-
- Type Parameters:
T- the entity bean type (normal entity bean type e.g. Customer)R- the specific root query bean type (e.g. QCustomer)
public abstract class TQAssocBean<T,R> extends TQProperty<R>
Base type for associated beans.
-
-
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Req(T other)Is equal to by ID property.RequalTo(T other)Is equal to by ID property.Rfetch()Eagerly fetch this association fetching all the properties.Rfetch(String properties)Eagerly fetch this association with the properties specified.RfetchAll()Deprecated.RfetchCache()Eagerly fetch this association using L2 bean cache.RfetchCache(String properties)Eagerly fetch this association using L2 cache with the properties specified.RfetchLazy()Use lazy loading for fetching this association.RfetchQuery()Eagerly fetch this association using a "query join".RfetchQuery(String properties)Eagerly fetch this association using a "query join" with the properties specified.RfilterMany(io.ebean.ExpressionList<T> filter)Apply a filter when fetching these beans.RfilterMany(String expressions, Object... params)Apply a filter when fetching these beans.RisEmpty()Is empty for a collection property.RisNotEmpty()Is not empty for a collection property.Rne(T other)Is not equal to by ID property.RnotEqualTo(T other)Is not equal to by ID property.-
Methods inherited from class io.ebean.typequery.TQProperty
isNotNull, isNull, toString
-
-
-
-
Constructor Detail
-
TQAssocBean
public TQAssocBean(String name, R root)
Construct with a property name and root instance.- Parameters:
name- the name of the propertyroot- the root query bean instance
-
TQAssocBean
public TQAssocBean(String name, R root, String prefix)
Construct with additional path prefix.
-
-
Method Detail
-
fetchQuery
public R fetchQuery()
Eagerly fetch this association using a "query join".
-
fetchCache
public R fetchCache()
Eagerly fetch this association using L2 bean cache. Cache misses are populated via fetchQuery().
-
fetch
public R fetch(String properties)
Eagerly fetch this association with the properties specified.
-
fetchQuery
public R fetchQuery(String properties)
Eagerly fetch this association using a "query join" with the properties specified.
-
fetchCache
public R fetchCache(String properties)
Eagerly fetch this association using L2 cache with the properties specified. Cache misses are populated via fetchQuery().
-
fetchAll
@Deprecated public R fetchAll()
Deprecated.Deprecated in favor of fetch().
-
notEqualTo
public R notEqualTo(T other)
Is not equal to by ID property.
-
filterMany
public R filterMany(io.ebean.ExpressionList<T> filter)
Apply a filter when fetching these beans.
-
filterMany
public R filterMany(String expressions, Object... params)
Apply a filter when fetching these beans.The expressions can use any valid Ebean expression and contain placeholders for bind values using
?or?1style.new QCustomer() .name.startsWith("Postgres") .contacts.filterMany("firstName istartsWith ?", "Rob") .findList();new QCustomer() .name.startsWith("Postgres") .contacts.filterMany("whenCreated inRange ? to ?", startDate, endDate) .findList();- Parameters:
expressions- The expressions including and, or, not etc with ? and ?1 bind params.params- The bind parameter values
-
isEmpty
public 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 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.
-
-