public class HibernateTopiaJpaSupport extends Object implements TopiaJpaSupport
| Modifier and Type | Field and Description |
|---|---|
protected TopiaFiresSupport |
firesSupport |
protected TopiaHibernateSupport |
hibernateSupport |
protected boolean |
useFlushMode
This flag permits to use (or not) the flush mode when doing queries.
|
| Constructor and Description |
|---|
HibernateTopiaJpaSupport(TopiaHibernateSupport hibernateSupport,
TopiaFiresSupport firesSupport) |
| Modifier and Type | Method and Description |
|---|---|
int |
execute(String jpaql,
Map<String,Object> parameters)
Execute JPA-QL operation on data (Update, Delete).
|
int |
execute(String jpaql,
Object... propertyNamesAndValues)
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> |
find(String jpaql,
int startIndex,
int endIndex,
Object... propertyNamesAndValues)
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> List<T> |
findAll(String jpaql,
Object... propertyNamesAndValues)
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 |
findUnique(String jpaql,
Map<String,Object> parameters)
Allow to do some JPA-QL query and return an unique result.
|
<T> T |
findUnique(String jpaql,
Object... propertyNamesAndValues)
Allow to do some JPA-QL query and return an unique result.
|
protected org.hibernate.Query |
prepareQuery(String jpaql,
Map<String,Object> parameters) |
void |
setUseFlushMode(boolean useFlushMode)
Tells to the context if it has to use a flush mode before each query.
|
protected TopiaHibernateSupport hibernateSupport
protected TopiaFiresSupport firesSupport
protected boolean useFlushMode
true), in that case whebn doing queries (says in method
findAll(String, Object...) or find(String, int, int, Object...))
it will use the flush mode FlushMode.AUTO).
But sometimes, when doing a lot of queries (for some imports for example),
we do NOT want the session to be flushed each time we do a find, then you
can set this flag to false using the method setUseFlushMode(boolean)public HibernateTopiaJpaSupport(TopiaHibernateSupport hibernateSupport, TopiaFiresSupport firesSupport)
public void setUseFlushMode(boolean useFlushMode)
TopiaJpaSupportfalse.setUseFlushMode in interface TopiaJpaSupportuseFlushMode - the new value to setprotected org.hibernate.Query prepareQuery(String jpaql, Map<String,Object> parameters)
public <T> List<T> findAll(String jpaql, Map<String,Object> parameters)
TopiaJpaSupportfindAll in interface TopiaJpaSupportjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuespublic <T> T findUnique(String jpaql, Map<String,Object> parameters)
TopiaJpaSupportfindUnique in interface TopiaJpaSupportjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuespublic <T> List<T> find(String jpaql, int startIndex, int endIndex, Map<String,Object> parameters)
TopiaJpaSupportstartIndex = 0.endIndex = -1.
WARNING : Depending on the registered service, this method may not
support something else than queries on TopiaEntityfind in interface TopiaJpaSupportjpaql - 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 valuespublic int execute(String jpaql, Map<String,Object> parameters)
TopiaJpaSupportexecute in interface TopiaJpaSupportjpaql - the JPA-QL queryparameters - a map which keys are the attribute names and values are the attributes expected valuespublic <T> List<T> findAll(String jpaql, Object... propertyNamesAndValues)
TopiaJpaSupportfindAll in interface TopiaJpaSupportjpaql - the JPA-QL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]public <T> List<T> find(String jpaql, int startIndex, int endIndex, Object... propertyNamesAndValues)
TopiaJpaSupportstartIndex = 0.endIndex = -1.
WARNING : Depending on the registered service, this method may not
support something else than queries on TopiaEntityfind in interface TopiaJpaSupportjpaql - the JPA-QL querystartIndex - first index of entity to returnendIndex - last index of entity to returnpropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]public <T> T findUnique(String jpaql, Object... propertyNamesAndValues)
TopiaJpaSupportfindUnique in interface TopiaJpaSupportjpaql - the JPA-QL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]public int execute(String jpaql, Object... propertyNamesAndValues)
TopiaJpaSupportexecute in interface TopiaJpaSupportjpaql - the JPA-QL querypropertyNamesAndValues - the query parameters. Arguments are key-value paired :
[propertyName;value;propertyName;value;...]Copyright © 2004–2013 CodeLutin. All rights reserved.