|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.jpa.core.DefaultJpaOperations
public class DefaultJpaOperations
Class similar to JPA template limited to the operations required for the JPA adapters/gateway not using JpaTemplate as the class is deprecated since Spring 3.1
Field Summary | |
---|---|
protected javax.persistence.EntityManager |
entityManager
|
Constructor Summary | |
---|---|
DefaultJpaOperations()
|
Method Summary | ||
---|---|---|
void |
afterPropertiesSet()
|
|
void |
delete(java.lang.Object entity)
|
|
void |
deleteInBatch(java.lang.Iterable<?> entities)
|
|
int |
executeUpdate(java.lang.String updateQuery,
ParameterSource source)
Executes the given update statement and uses the given parameter source to set the required query parameters. |
|
int |
executeUpdateWithNamedQuery(java.lang.String updateQuery,
ParameterSource source)
|
|
int |
executeUpdateWithNativeQuery(java.lang.String updateQuery,
ParameterSource source)
|
|
|
find(java.lang.Class<T> entityType,
java.lang.Object id)
Find an Entity of given type with the given primary key type. |
|
java.util.List<?> |
getResultListForClass(java.lang.Class<?> entityClass,
int maxNumberOfResults)
|
|
java.util.List<?> |
getResultListForNamedQuery(java.lang.String selectNamedQuery,
ParameterSource parameterSource,
int maxNumberOfResults)
|
|
java.util.List<?> |
getResultListForNativeQuery(java.lang.String selectQuery,
java.lang.Class<?> entityClass,
ParameterSource parameterSource,
int maxNumberOfResults)
|
|
java.util.List<?> |
getResultListForQuery(java.lang.String query,
ParameterSource source)
Executes the provided query to return a list of results |
|
java.util.List<?> |
getResultListForQuery(java.lang.String queryString,
ParameterSource source,
int maxNumberOfResults)
Executes the provided query to return a list of results. |
|
java.lang.Object |
getSingleResultForQuery(java.lang.String queryString,
ParameterSource source)
Executes the provided query to return a single element |
|
java.lang.Object |
merge(java.lang.Object entity)
The entity to be merged with the entity manager |
|
protected void |
onInit()
Subclasses may implement this for initialization logic. |
|
void |
persist(java.lang.Object entity)
Persists the entity |
|
void |
setEntityManager(javax.persistence.EntityManager entityManager)
|
|
void |
setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.persistence.EntityManager entityManager
Constructor Detail |
---|
public DefaultJpaOperations()
Method Detail |
---|
public void delete(java.lang.Object entity)
public void deleteInBatch(java.lang.Iterable<?> entities)
public int executeUpdate(java.lang.String updateQuery, ParameterSource source)
JpaOperations
updateQuery
- Must Not be empty.source
- Must Not be null.
public int executeUpdateWithNamedQuery(java.lang.String updateQuery, ParameterSource source)
public int executeUpdateWithNativeQuery(java.lang.String updateQuery, ParameterSource source)
public <T> T find(java.lang.Class<T> entityType, java.lang.Object id)
JpaOperations
public java.util.List<?> getResultListForClass(java.lang.Class<?> entityClass, int maxNumberOfResults)
public java.util.List<?> getResultListForNamedQuery(java.lang.String selectNamedQuery, ParameterSource parameterSource, int maxNumberOfResults)
public java.util.List<?> getResultListForNativeQuery(java.lang.String selectQuery, java.lang.Class<?> entityClass, ParameterSource parameterSource, int maxNumberOfResults)
public java.util.List<?> getResultListForQuery(java.lang.String query, ParameterSource source)
JpaOperations
source
- the Parameter source for this query to be executed, if none then set as null
public java.util.List<?> getResultListForQuery(java.lang.String queryString, ParameterSource source, int maxNumberOfResults)
JpaOperations
queryString
- Must not be null or emptysource
- the Parameter source for this query to be executed, if none then set nullmaxNumberOfResults
- Must be a non-negative value
public java.lang.Object getSingleResultForQuery(java.lang.String queryString, ParameterSource source)
JpaOperations
queryString
- Must not be emptysource
- the Parameter source for this query to be executed, if none then set as null
public java.lang.Object merge(java.lang.Object entity)
JpaOperations
entity
- Must not be null.
public void persist(java.lang.Object entity)
JpaOperations
entity
- Must not be nullpublic void setEntityManager(javax.persistence.EntityManager entityManager)
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
public final void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected void onInit()
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |