public class JPAModelLoader extends Object implements Model.Factory
Constructor and Description |
---|
JPAModelLoader(Class<? extends Model> clazz) |
Modifier and Type | Method and Description |
---|---|
Long |
count(List<String> searchFields,
String keywords,
String where) |
void |
deleteAll() |
List<Model> |
fetch(int offset,
int size,
String orderBy,
String order,
List<String> searchFields,
String keywords,
String where)
Retrieve a list of result
|
Model |
findById(Object id)
Find object by ID
|
static Set<Field> |
getModelFields(Class<?> clazz) |
String |
keyName() |
String[] |
keyNames() |
Class<?> |
keyType() |
Class<?>[] |
keyTypes() |
Object |
keyValue(Model m) |
List<Model.Property> |
listProperties()
List of all properties
|
public Model findById(Object id)
findById
in interface Model.Factory
id
- : the id of the entitypublic List<Model> fetch(int offset, int size, String orderBy, String order, List<String> searchFields, String keywords, 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 Long count(List<String> searchFields, String keywords, String where)
count
in interface Model.Factory
public void deleteAll()
deleteAll
in interface Model.Factory
public List<Model.Property> listProperties()
listProperties
in interface Model.Factory
public String keyName()
keyName
in interface Model.Factory
public Class<?> keyType()
keyType
in interface Model.Factory
public Class<?>[] keyTypes()
public String[] keyNames()
public Object keyValue(Model m)
keyValue
in interface Model.Factory
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly