|
27 | 27 | import io.objectbox.Box;
|
28 | 28 | import io.objectbox.EntityInfo;
|
29 | 29 | import io.objectbox.Property;
|
30 |
| -import io.objectbox.annotation.apihint.Experimental; |
31 | 30 | import io.objectbox.annotation.apihint.Internal;
|
32 | 31 | import io.objectbox.exception.DbException;
|
33 | 32 | import io.objectbox.relation.RelationInfo;
|
34 | 33 |
|
35 | 34 | /**
|
36 |
| - * With QueryBuilder you define custom queries returning matching entities. Using the methods of this class you can |
37 |
| - * select (filter) results for specific data (for example #{@link #equal(Property, String)} and |
38 |
| - * {@link #isNull(Property)}) and select an sort order for the resulting list (see {@link #order(Property)} and its |
39 |
| - * overloads). |
| 35 | + * Builds a {@link Query Query} using conditions which can then be used to return a list of matching Objects. |
40 | 36 | * <p>
|
41 |
| - * Use {@link #build()} to conclude your query definitions and to get a {@link Query} object, which is used to actually |
42 |
| - * get results. |
| 37 | + * A simple example: |
| 38 | + * |
| 39 | + * <pre> |
| 40 | + * userBox.query() |
| 41 | + * .equal(User_.firstName, "Joe") |
| 42 | + * .order(User_.lastName) |
| 43 | + * .build() |
| 44 | + * .find() |
| 45 | + * </pre> |
| 46 | + * |
| 47 | + * <p> |
| 48 | + * To add a condition use the appropriate method, for example {@link #equal(Property, String)} or |
| 49 | + * {@link #isNull(Property)}. To order results use {@link #order(Property)} and its related methods. |
| 50 | + * <p> |
| 51 | + * Use {@link #build()} to create a {@link Query} object, which is used to actually get the results. |
| 52 | + * <p> |
| 53 | + * Note: by default Query returns full Objects. To return only values or an aggregate value for a single Property, |
| 54 | + * use {@link Query#property(Property)}. |
43 | 55 | * <p>
|
44 |
| - * Note: Currently you can only query for complete entities. Returning individual property values or aggregates are |
45 |
| - * currently not available. Keep in mind that ObjectBox is very fast and the overhead to create an entity is very low. |
| 56 | + * See the <a href="https://docs.objectbox.io/queries">Queries documentation</a> for details. |
46 | 57 | *
|
47 |
| - * @param <T> Entity class associated with this query builder. |
| 58 | + * @param <T> Entity class for which the Query is built. |
48 | 59 | */
|
49 | 60 | @SuppressWarnings({"WeakerAccess", "UnusedReturnValue", "unused"})
|
50 | 61 | public class QueryBuilder<T> implements Closeable {
|
|
0 commit comments