play.db.jpa

## Class JPAModelLoader

- java.lang.Object
- - play.db.jpa.JPAModelLoader

- All Implemented Interfaces:
    Model.Factory

      public class JPAModelLoader
      extends java.lang.Object
      implements Model.Factory

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JPAModelLoader(java.lang.Class<? extends Model> clazz)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Long` | `count(java.util.List<java.lang.String> searchFields, java.lang.String keywords, java.lang.String where)`
    `void` | `deleteAll()`
    `java.util.List<Model>` | `fetch(int offset, int size, java.lang.String orderBy, java.lang.String order, java.util.List<java.lang.String> searchFields, java.lang.String keywords, java.lang.String where)` Retrieve a list of result
    `Model` | `findById(java.lang.Object id)` Find object by ID
    `static java.util.Set<java.lang.reflect.Field>` | `getModelFields(java.lang.Class<?> clazz)`
    `java.lang.String` | `keyName()`
    `java.lang.String[]` | `keyNames()`
    `java.lang.Class<?>` | `keyType()`
    `java.lang.Class<?>[]` | `keyTypes()`
    `java.lang.Object` | `keyValue(Model m)`
    `java.util.List<Model.Property>` | `listProperties()` List of all properties

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JPAModelLoader

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

  - ### Method Detail

    - #### findById

          public Model findById(java.lang.Object id)

      Find object by ID
      Specified by:
        `findById` in interface `Model.Factory`
      Parameters:
        `id` - : the id of the entity

    - #### fetch

          public java.util.List<Model> fetch(int offset,
                                             int size,
                                             java.lang.String orderBy,
                                             java.lang.String order,
                                             java.util.List<java.lang.String> searchFields,
                                             java.lang.String keywords,
                                             java.lang.String where)

      Retrieve a list of result
      Specified by:
        `fetch` in interface `Model.Factory`
      Parameters:
        `offset` - position of the first result, numbered from 0
        `size` - maximum number of results to retrieve
        `orderBy` - Order by field
        `order` - Sorting order
        `searchFields` - (page length)
        `keywords` - (page length)
        `where` - (page length)
      Returns:
        a list of results

    - #### count

          public java.lang.Long count(java.util.List<java.lang.String> searchFields,
                                      java.lang.String keywords,
                                      java.lang.String where)

      Specified by:
        `count` in interface `Model.Factory`

    - #### deleteAll

          public void deleteAll()

      Specified by:
        `deleteAll` in interface `Model.Factory`

    - #### listProperties

          public java.util.List<Model.Property> listProperties()

      List of all properties
      Specified by:
        `listProperties` in interface `Model.Factory`

    - #### keyName

          public java.lang.String keyName()

      Specified by:
        `keyName` in interface `Model.Factory`

    - #### keyType

          public java.lang.Class<?> keyType()

      Specified by:
        `keyType` in interface `Model.Factory`

    - #### keyTypes

          public java.lang.Class<?>[] keyTypes()

    - #### keyNames

          public java.lang.String[] keyNames()

    - #### keyValue

          public java.lang.Object keyValue(Model m)

      Specified by:
        `keyValue` in interface `Model.Factory`

    - #### getModelFields

          public static java.util.Set<java.lang.reflect.Field> getModelFields(java.lang.Class<?> clazz)

Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly