ID - The type of the primary key of the entity managed by this DAOT - The type of the entity managed by this DAOpublic interface BaseDao<ID,T extends AbstractEntity<ID>>
| Modifier and Type | Method and Description |
|---|---|
long |
count()
Returns the total number of entities of this type
|
long |
count(Filter filter,
boolean distinct)
Returns the number of entities that match the provided filter
|
long |
count(com.mysema.query.types.Predicate predicate)
Returns the number of entities that match the provided predicate
|
void |
delete(List<T> list)
Deletes all entities in the provided list
|
void |
delete(T entity)
Deletes the provided entity
|
List<T> |
fetch(Filter filter,
FetchJoinInformation... joins)
Fetches entities that match the provided filter
|
List<T> |
fetch(Filter filter,
Pageable pageable,
FetchJoinInformation... joins)
Fetches entities that match the provided filter
|
List<T> |
fetch(Filter filter,
SortOrders orders,
FetchJoinInformation... joins)
Fetches entities that match the provided filter
|
T |
fetchById(ID id,
FetchJoinInformation... joins)
Fetches an entity (and its relations) based on its ID
|
List<T> |
fetchByIds(List<ID> ids,
SortOrders sortOrders,
FetchJoinInformation... joins)
Fetches the entities identified by the provided IDs
|
T |
fetchByUniqueProperty(String propertyName,
Object value,
boolean caseSensitive,
FetchJoinInformation... joins)
Fetches an entity based on a unique property
|
List<T> |
find(Filter filter)
Returns all entities that match the provided filter
|
List<T> |
find(Filter filter,
SortOrder... orders)
Returns all entities that match the provided filter
|
List<T> |
find(com.mysema.query.types.Predicate predicate)
Returns all entities that match a certain predicate
|
List<T> |
find(com.mysema.query.types.Predicate predicate,
int firstIndex,
int maxResults,
SortOrder... sorts)
Finds the entities that match a certain predicate
|
List<T> |
findAll()
Returns a list of all entities.
|
List<T> |
findAll(SortOrder... sortOrders)
Returns a list of all entities.
|
T |
findById(ID id)
Finds an object based on its ID
|
T |
findByUniqueProperty(String propertyName,
Object value,
boolean caseSensitive)
Finds an object based on a unique property value
|
<S> List<S> |
findDistinct(Filter filter,
String distinctField,
Class<S> elementType,
SortOrder... orders)
Returns all entities that match the provided filter and apply a distinct on the given column
|
<S> List<S> |
findDistinctInCollectionTable(String tableName,
String distinctField,
Class<S> elementType)
Returns all distinct values in a collection table
|
List<ID> |
findIds(Filter filter,
SortOrder... orders)
Returns the IDS of the entities that match the provided filter
|
void |
flushAndClear()
Flushes and clears the entity manager (useful after an explicit update or delete)
|
Class<T> |
getEntityClass()
Returns the class of the entity managed by this DAO
|
List<T> |
save(List<T> list)
Saves the provide list of entities
|
T |
save(T entity)
Saves the provided entity
|
long count()
long count(Filter filter, boolean distinct)
filter - the filterdistinct - whether to return only distinct resultslong count(com.mysema.query.types.Predicate predicate)
predicate - the predicatevoid delete(List<T> list)
list - the list of entities to deletevoid delete(T entity)
entity - the entity to deleteList<T> fetch(Filter filter, FetchJoinInformation... joins)
filter - the filterjoins - the desired relations to fetchList<T> fetch(Filter filter, Pageable pageable, FetchJoinInformation... joins)
filter - the filterpageable - the page infojoins - the desired relations to fetchList<T> fetch(Filter filter, SortOrders orders, FetchJoinInformation... joins)
filter - the filterpageable - the page infojoins - the desired relations to fetchT fetchById(ID id, FetchJoinInformation... joins)
id - the ID of the entityjoins - the desired relations to fetchList<T> fetchByIds(List<ID> ids, SortOrders sortOrders, FetchJoinInformation... joins)
ids - the IDs of the entities to fetchsort - the sort orderjoins - the desired relations to fetchT fetchByUniqueProperty(String propertyName, Object value, boolean caseSensitive, FetchJoinInformation... joins)
propertyName - the name of the propertyvalue - the value of the propertycaseSensitive - indicates whether the value is case sensitivejoins - the desired relations to fetchList<T> find(Filter filter)
filter - the filterList<T> find(Filter filter, SortOrder... orders)
filter - the filtersort - the sort infoList<T> find(com.mysema.query.types.Predicate predicate)
predicate - the predicateList<T> find(com.mysema.query.types.Predicate predicate, int firstIndex, int maxResults, SortOrder... sorts)
predicate - the predicatefirstIndex - the index of the first resultmaxResults - the maximum number of resultssorts - the sort order informationList<T> findAll(SortOrder... sortOrders)
sort - the desired sorting informationT findById(ID id)
id - the IDnull if it cannot be foundT findByUniqueProperty(String propertyName, Object value, boolean caseSensitive)
propertyName - the name of the propertyvalue - the desired value of the propertycaseSensitive - whether the match is case sensitiveList<ID> findIds(Filter filter, SortOrder... orders)
filter - the filtersort - the desired sortingvoid flushAndClear()
Class<T> getEntityClass()
List<T> save(List<T> list)
list - the list of entities<S> List<S> findDistinct(Filter filter, String distinctField, Class<S> elementType, SortOrder... orders)
filter - the filterdistinctField - the field used to remove duplicate rowsorders - the sort infoCopyright © 2017 Open Circle Solutions. All rights reserved.