From d56e071f53cea2401b16c8b227a3c218b3d2a4a7 Mon Sep 17 00:00:00 2001
From: Robin Bygrave
* This is the same as indexByQuery where the query has no predicates and so fetches all rows. + *
*/ void indexAll(Class> beanType); /** * Return the bean by fetching it's content from the document store. * If the document is not found null is returned. + *+ * Typically this is called indirectly by findUnique() on the query. + *
+ *{@code
+ *
+ * Customer customer =
+ * server.find(Customer.class)
+ * .setUseDocStore(true)
+ * .setId(42)
+ * .findUnique();
+ *
+ * }
*/
@Nullable
+ * Typically this is called indirectly by findList() on the query that has setUseDocStore(true). + *
+ *{@code
+ *
+ * List newCustomers =
+ * server.find(Customer.class)
+ * .setUseDocStore(true)
+ * .where().eq("status, Customer.Status.NEW)
+ * .findList();
+ *
+ * }
*/
* The query should have firstRow or maxRows set prior to calling this method.
*
+ * Typically this is called indirectly by findPagedList() on the query that has setUseDocStore(true). + *
+ * + *{@code
+ *
+ * PagedList newCustomers =
+ * server.find(Customer.class)
+ * .setUseDocStore(true)
+ * .where().eq("status, Customer.Status.NEW)
+ * .setMaxRows(50)
+ * .findPagedList();
+ *
+ * }
+ *
*/
* For example, with the ElasticSearch doc store this uses SCROLL. *
+ *+ * Typically this is called indirectly by findEach() on the query that has setUseDocStore(true). + *
+ * + *{@code
+ *
+ * server.find(Order.class)
+ * .setUseDocStore(true)
+ * .where()... // perhaps add predicates
+ * .findEach(new QueryEachConsumer() {
+ * @Override
+ * public void accept(Order bean) {
+ * // process the bean
+ * }
+ * });
+ *
+ * }
*/
* For example, with the ElasticSearch doc store this uses SCROLL. *
+ *+ * Typically this is called indirectly by findEachWhile() on the query that has setUseDocStore(true). + *
+ * + * + *{@code
+ *
+ * server.find(Order.class)
+ * .setUseDocStore(true)
+ * .where()... // perhaps add predicates
+ * .findEachWhile(new QueryEachWhileConsumer() {
+ * @Override
+ * public void accept(Order bean) {
+ * // process the bean
+ *
+ * // return true to continue, false to stop
+ * // boolean shouldContinue = ...
+ * return shouldContinue;
+ * }
+ * });
+ *
+ * }
*/
{@code
+ *
+ * DocumentStore documentStore = server.docStore();
+ *
+ * documentStore.dropIndex("product_copy");
+ *
+ * }
+ *
*/
void dropIndex(String indexName);
/**
* Create an index given a mapping file as a resource in the classPath (similar to DDL create table).
*
+ * {@code
+ *
+ * DocumentStore documentStore = server.docStore();
+ *
+ * // uses product_copy.mapping.json resource
+ * // ... to define mappings for the index
+ *
+ * documentStore.createIndex("product_copy", null);
+ *
+ * }
+ *
* @param indexName the name of the new index
* @param alias the alias of the index
*/
@@ -115,7 +217,6 @@ public interface DocumentStore {
*
* }
*
- *
* @param beanType The bean type of the source index
* @param newIndex The name of the index to copy to
* @return the number of documents copied to the new index
@@ -135,7 +236,6 @@ public interface DocumentStore {
*
* }
*
- *
* @param beanType The bean type of the source index
* @param newIndex The name of the index to copy to
* @return the number of documents copied to the new index