public class JPAModelLoader extends java.lang.Object implements Model.Factory
Constructor and Description |
---|
JPAModelLoader(java.lang.Class<? extends Model> clazz) |
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
|
public JPAModelLoader(java.lang.Class<? extends Model> clazz)
public Model findById(java.lang.Object id)
findById
in interface Model.Factory
id
- : the id of the entitypublic 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)
fetch
in interface Model.Factory
offset
- position of the first result, numbered from 0size
- maximum number of results to retrieveorderBy
- Order by fieldorder
- Sorting ordersearchFields
- (page length)keywords
- (page length)where
- (page length)public java.lang.Long count(java.util.List<java.lang.String> searchFields, java.lang.String keywords, java.lang.String where)
count
in interface Model.Factory
public void deleteAll()
deleteAll
in interface Model.Factory
public java.util.List<Model.Property> listProperties()
listProperties
in interface Model.Factory
public java.lang.String keyName()
keyName
in interface Model.Factory
public java.lang.Class<?> keyType()
keyType
in interface Model.Factory
public java.lang.Class<?>[] keyTypes()
public java.lang.String[] keyNames()
public java.lang.Object keyValue(Model m)
keyValue
in interface Model.Factory
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