public interface TopiaJpaSupport
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Object object)
Remove a persistent instance.
|
int |
execute(String jpaql,
Map<String,Object> parameters)
Execute JPA-QL operation on data (Update, Delete).
|
<T> List<T> |
find(String jpaql,
int startIndex,
int endIndex,
Map<String,Object> parameters)
Allow to do some JPA-QL query using the given bounds.
|
<T> List<T> |
findAll(String jpaql,
Map<String,Object> parameters)
Allow to do some JPA-QL query
WARNING : Depending on the registered service, this method may not
support something else than queries on TopiaEntity
|
<T> T |
findAny(String jpaql,
Map<String,Object> parameters)
Allow to do some JPA-QL query and return a single result.
|
<T> T |
findUnique(String jpaql,
Map<String,Object> parameters)
Allow to do some JPA-QL query and return an unique result.
|
void |
save(Object object)
Persist the given transient instance, first assigning a generated identifier.
|
void |
saveOrUpdate(Object object)
Either
save(Object) or update(Object) the given instance. |
void |
setSlowQueriesThreshold(Duration threshold)
Tells to the context after which delay a query should be considered as slow.
|
void |
setUseFlushMode(boolean useFlushMode)
Tells to the context if it has to use a flush mode before each query.
|
default <T> Stream<T> |
stream(String jpaql,
Map<String,Object> parameters)
Streaming on the result of a
findAll(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>). |
void |
update(Object object)
Update the persistent instance with the identifier of the given detached instance.
|
<T> List<T> findAll(String jpaql, Map<String,Object> parameters)
T - type of resultjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuesdefault <T> Stream<T> stream(String jpaql, Map<String,Object> parameters)
findAll(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>).
Streaming is not part of JPA but may be part a JPA implementation so we provide
a default implementation that will work on any JPA vendor.<T> List<T> find(String jpaql, int startIndex, int endIndex, Map<String,Object> parameters) throws QueryMissingOrderException
startIndex = 0.endIndex = -1.T - type of resultjpaql - the JPA-QL querystartIndex - first index of entity to returnendIndex - last index of entity to returnparameters - a map which keys are the attribute names and values are the attributes expected valuesQueryMissingOrderException - if no order by clause is specified<T> T findAny(String jpaql, Map<String,Object> parameters)
T - type of resultjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected values<T> T findUnique(String jpaql, Map<String,Object> parameters)
T - type of resultjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuesint execute(String jpaql, Map<String,Object> parameters)
jpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuesvoid setUseFlushMode(boolean useFlushMode)
false.useFlushMode - the new value to setvoid setSlowQueriesThreshold(Duration threshold)
threshold - the new value to setvoid save(Object object)
object - a transient instance of a persistent classvoid update(Object object)
object - a detached instance containing updated statevoid saveOrUpdate(Object object)
save(Object) or update(Object) the given instance.
This method is "inspired" of the Hibernate's Session#saveOrUpdate method.object - a transient or detached instance containing new or updated statesave(java.lang.Object),
update(Object object)void delete(Object object)
object - the instance to be removedCopyright © 2004–2020 Code Lutin. All rights reserved.