Skip to content

Commit 330639d

Browse files
committed
JavaDocs for QueryBuilder.eager(...)
1 parent 974f933 commit 330639d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

objectbox-java/src/main/java/io/objectbox/query/QueryBuilder.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,25 @@ public QueryBuilder<T> order(Property property, int flags) {
212212
return this;
213213
}
214214

215+
/**
216+
* Specifies relations that should be resolved eagerly.
217+
* This prepares the given relation objects to be preloaded (cached) avoiding further get operations from the db.
218+
* A common use case is prealoading all
219+
*
220+
* @param relationInfo The relation as found in the generated meta info class ("EntityName_") of class T.
221+
* @param more Supply further relations to be eagerly loaded.
222+
*/
215223
public QueryBuilder<T> eager(RelationInfo relationInfo, RelationInfo... more) {
216224
return eager(0, relationInfo, more);
217225
}
218226

227+
/**
228+
* Like {@link #eager(RelationInfo, RelationInfo[])}, but limits eager loading to the given count.
229+
*
230+
* @param limit Count of entities to be eager loaded.
231+
* @param relationInfo The relation as found in the generated meta info class ("EntityName_") of class T.
232+
* @param more Supply further relations to be eagerly loaded.
233+
*/
219234
public QueryBuilder<T> eager(int limit, RelationInfo relationInfo, RelationInfo... more) {
220235
if (eagerRelations == null) {
221236
eagerRelations = new ArrayList<>();

0 commit comments

Comments
 (0)