Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## play.modules.morphia
Class Model.MorphiaQuery

    java.lang.Object
      play.modules.morphia.Model.MorphiaQuery

Enclosing class:
  Model

    public static class Model.MorphiaQuery

extends java.lang.Object

Constructor Summary
`Model.MorphiaQuery(java.lang.Class<? extends Model> clazz)`
`Model.MorphiaQuery(java.lang.Class<? extends Model> clazz, DBCollection coll, Datastore ds)`
`Model.MorphiaQuery(java.lang.Class<? extends Model> clazz, DBCollection coll, Datastore ds, int offset, int limit)`

Method Summary
`Model` | `_get()`
`
`<T extends Model> CriteriaContainer`
` | `and(Criteria... criteria)`
`
`<T extends Model> java.util.List<>`
` | `asKeyList()`
`
`<T extends Model> java.util.List<T>`
` | `asList()`
`java.lang.Long` | `average(java.lang.String field)`
`
`<T extends Model> Model.MorphiaQuery`
` | `batchSize(int value)`
`Model.MorphiaQuery` | `clone()`
`java.util.Map<java.lang.String,java.lang.Long>` | `cloud(java.lang.String field)`
`DBCollection` | `col()`
`long` | `count()` Alias of countAll()
`long` | `countAll()`
`
`<T extends Model>`
` | `criteria(java.lang.String field)`
`long` | `delete()`
`
`<T extends Model> Model.MorphiaQuery`
` | `disableCursorTimeout()`
`
`<T extends Model> Model.MorphiaQuery`
` | `disableSnapshotMode()`
`
`<T extends Model> Model.MorphiaQuery`
` | `disableTimeout()` Deprecated.
`
`<T extends Model> Model.MorphiaQuery`
` | `disableValidation()`
`java.util.Set<?>` | `distinct(java.lang.String key)`
`static Datastore` | `ds()`
`
`<T extends Model> Model.MorphiaQuery`
` | `enableCursorTimeout()`
`
`<T extends Model> Model.MorphiaQuery`
` | `enableSnapshotMode()`
`
`<T extends Model> Model.MorphiaQuery`
` | `enableTimeout()` Deprecated.
`
`<T extends Model> Model.MorphiaQuery`
` | `enableValidation()`
`
`<T extends Model> java.lang.Iterable<T>`
` | `fetch()`
`
`<T extends Model> java.util.List<T>`
` | `fetch(int max)` Retrieve results of the query
`
`<T extends Model> java.util.List<T>`
` | `fetch(int page, int length)` Retrieve a page of result
`
`<T extends Model> java.util.List<T>`
` | `fetchAll()` Retrieve all results of the query This is a correspondence to JPAQuery's fetch(), which however, used as another method signature of Morphia Query
`
`<T extends Model> java.lang.Iterable<T>`
` | `fetchEmptyEntities()`
`
`<T extends Model> java.lang.Iterable<>`
` | `fetchKeys()`
`
`<T extends Model>`
` | `field(java.lang.String field)`
`
`<T extends Model> Model.MorphiaQuery`
` | `filter(java.lang.String condition, java.lang.Object value)`
`Model.MorphiaQuery` | `findBy(java.lang.String query, java.lang.Object... params)` Used to simulate JPA.find("byXXAndYY", ...);
`
`<T> T`
` | `first()`
`
`<T> Model.MorphiaQuery`
` | `from(int position)` Set the position to start
`
`<T extends Model> T`
` | `get()`
`java.lang.Class<? extends Model>` | `getEntityClass()`
`
`<T extends Model>`
` | `getKey()`
`` | `getMorphiaQuery()`
`DBObject` | `getQueryObject()`
`java.util.List<CommandResult>` | `group(java.lang.String groupKeys, DBObject initial, java.lang.String reduce, java.lang.String finalize)`
`AggregationResult` | `groupAverage(java.lang.String field, java.lang.String... groupKeys)`
`AggregationResult` | `groupCount(java.lang.String field, java.lang.String... groupKeys)`
`AggregationResult` | `groupMax(java.lang.String field, java.lang.String... groupKeys)`
`AggregationResult` | `groupMin(java.lang.String field, java.lang.String... groupKeys)`
`AggregationResult` | `groupSum(java.lang.String field, java.lang.String... groupKeys)`
`
`<T extends Model> Model.MorphiaQuery`
` | `hintIndex(java.lang.String idxName)`
`
`<T extends Model> java.util.Iterator<T>`
` | `iterator()`
`
`<T extends Model> Model.MorphiaQuery`
` | `limit(int value)`
`java.lang.Long` | `max(java.lang.String maxField)`
`java.lang.Long` | `min(java.lang.String minField)`
`
`<T extends Model> Model.MorphiaQuery`
` | `offset(int value)`
`
`<T extends Model> CriteriaContainer`
` | `or(Criteria... criteria)`
`
`<T extends Model> Model.MorphiaQuery`
` | `order(java.lang.String condition)`
`
`<T extends Model> Model.MorphiaQuery`
` | `queryNonPrimary()`
`
`<T extends Model> Model.MorphiaQuery`
` | `queryPrimaryOnly()`
`
`<T extends Model> Model.MorphiaQuery`
` | `retrievedFields(boolean include, java.lang.String... fields)`
`
`<T extends Model> Model.MorphiaQuery`
` | `skip(int value)` Deprecated.
`java.lang.Long` | `sum(java.lang.String field)`
`java.lang.String` | `toString()`
`
`<T extends Model> Model.MorphiaQuery`
` | `where(CodeWScope js)`
`
`<T extends Model> Model.MorphiaQuery`
` | `where(java.lang.String js)`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Model.MorphiaQuery

    public Model.MorphiaQuery(java.lang.Class<? extends Model> clazz)

### Model.MorphiaQuery

    public Model.MorphiaQuery(java.lang.Class<? extends Model> clazz,
                              DBCollection coll,
                              Datastore ds)

### Model.MorphiaQuery

    public Model.MorphiaQuery(java.lang.Class<? extends Model> clazz,
                              DBCollection coll,
                              Datastore ds,
                              int offset,
                              int limit)

Method Detail

### ds

    public static Datastore ds()

### getMorphiaQuery

    public  getMorphiaQuery()

### getQueryObject

    public DBObject getQueryObject()

### col

    public DBCollection col()

### delete

    public long delete()

### count

    public long count()

  Alias of countAll()

  Returns:

### findBy

    public Model.MorphiaQuery findBy(java.lang.String query,
                                     java.lang.Object... params)

  Used to simulate JPA.find("byXXAndYY", ...);

  Parameters:
    `query` - could be either "Key1[AndKey2[AndKey3]]" or "byKey1[AndKey2[AndKey3]]" or "key1 key2 ..."
    `params` - the number of params should either be exactly one or the number match the key number
  Returns:

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### first

    public <T> T first()

### from

    public <T> Model.MorphiaQuery from(int position)

  Set the position to start

  Parameters:
    `position` - Position of the first element
  Returns:
    A new query

### fetchAll

    public <T extends Model> java.util.List<T> fetchAll()

  Retrieve all results of the query This is a correspondence to JPAQuery's fetch(), which however, used as another method signature of Morphia Query

  Returns:
    A list of entities

### fetch

    public <T extends Model> java.util.List<T> fetch(int max)

  Retrieve results of the query

  Parameters:
    `max` - Max results to fetch
  Returns:
    A list of entities

### fetch

    public <T extends Model> java.util.List<T> fetch(int page,
                                                     int length)

  Retrieve a page of result

  Parameters:
    `page` - Page number (start at 1)
    `length` - (page length)
  Returns:
    a list of entities

### _get

    public Model _get()

### get

    public <T extends Model> T get()

### filter

    public <T extends Model> Model.MorphiaQuery filter(java.lang.String condition,
                                                       java.lang.Object value)

### getKey

    public <T extends Model>  getKey()

### iterator

    public <T extends Model> java.util.Iterator<T> iterator()

### asList

    public <T extends Model> java.util.List<T> asList()

### asKeyList

    public <T extends Model> java.util.List<> asKeyList()

### fetch

    public <T extends Model> java.lang.Iterable<T> fetch()

### distinct

    public java.util.Set<?> distinct(java.lang.String key)

### cloud

    public java.util.Map<java.lang.String,java.lang.Long> cloud(java.lang.String field)

### group

    public java.util.List<CommandResult> group(java.lang.String groupKeys,
                                               DBObject initial,
                                               java.lang.String reduce,
                                               java.lang.String finalize)

  Parameters:
    `groupKeys` - could be either "f1Andf2.." or "f1 f2" or "f1,f2"
  Returns:

### groupMax

    public AggregationResult groupMax(java.lang.String field,
                                      java.lang.String... groupKeys)

### max

    public java.lang.Long max(java.lang.String maxField)

### groupMin

    public AggregationResult groupMin(java.lang.String field,
                                      java.lang.String... groupKeys)

### min

    public java.lang.Long min(java.lang.String minField)

### groupAverage

    public AggregationResult groupAverage(java.lang.String field,
                                          java.lang.String... groupKeys)

### average

    public java.lang.Long average(java.lang.String field)

### groupSum

    public AggregationResult groupSum(java.lang.String field,
                                      java.lang.String... groupKeys)

### sum

    public java.lang.Long sum(java.lang.String field)

### groupCount

    public AggregationResult groupCount(java.lang.String field,
                                        java.lang.String... groupKeys)

### fetchEmptyEntities

    public <T extends Model> java.lang.Iterable<T> fetchEmptyEntities()

### field

    public <T extends Model>  field(java.lang.String field)

### fetchKeys

    public <T extends Model> java.lang.Iterable<> fetchKeys()

### criteria

    public <T extends Model>  criteria(java.lang.String field)

### and

    public <T extends Model> CriteriaContainer and(Criteria... criteria)

### countAll

    public long countAll()

### or

    public <T extends Model> CriteriaContainer or(Criteria... criteria)

### where

    public <T extends Model> Model.MorphiaQuery where(java.lang.String js)

### where

    public <T extends Model> Model.MorphiaQuery where(CodeWScope js)

### order

    public <T extends Model> Model.MorphiaQuery order(java.lang.String condition)

### limit

    public <T extends Model> Model.MorphiaQuery limit(int value)

### batchSize

    public <T extends Model> Model.MorphiaQuery batchSize(int value)

### offset

    public <T extends Model> Model.MorphiaQuery offset(int value)

### skip

    @Deprecated
    public <T extends Model> Model.MorphiaQuery skip(int value)

  Deprecated.

### enableValidation

    public <T extends Model> Model.MorphiaQuery enableValidation()

### disableValidation

    public <T extends Model> Model.MorphiaQuery disableValidation()

### hintIndex

    public <T extends Model> Model.MorphiaQuery hintIndex(java.lang.String idxName)

### retrievedFields

    public <T extends Model> Model.MorphiaQuery retrievedFields(boolean include,
                                                                java.lang.String... fields)

### enableSnapshotMode

    public <T extends Model> Model.MorphiaQuery enableSnapshotMode()

### disableSnapshotMode

    public <T extends Model> Model.MorphiaQuery disableSnapshotMode()

### queryNonPrimary

    public <T extends Model> Model.MorphiaQuery queryNonPrimary()

### queryPrimaryOnly

    public <T extends Model> Model.MorphiaQuery queryPrimaryOnly()

### disableTimeout

    @Deprecated
    public <T extends Model> Model.MorphiaQuery disableTimeout()

  Deprecated.

### disableCursorTimeout

    public <T extends Model> Model.MorphiaQuery disableCursorTimeout()

### enableTimeout

    @Deprecated
    public <T extends Model> Model.MorphiaQuery enableTimeout()

  Deprecated.

### enableCursorTimeout

    public <T extends Model> Model.MorphiaQuery enableCursorTimeout()

### getEntityClass

    public java.lang.Class<? extends Model> getEntityClass()

### clone

    public Model.MorphiaQuery clone()

  Overrides:
    `clone` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD