org.springframework.orm.jpa.JpaOperations |
Known Indirect Subclasses
JpaTemplate |
Helper class that allows for writing JPA data access code in the same style
as with Spring's well-known JdoTemplate and HibernateTemplate classes. |
|
Class Overview
Interface that specifies a basic set of JPA operations,
implemented by JpaTemplate
. Not often used, but a useful
option to enhance testability, as it can easily be mocked or stubbed.
Defines JpaTemplate
's data access methods that mirror
various javax.persistence.EntityManager methods. Users are
strongly encouraged to read the JPA EntityManager
javadocs for details on the semantics of those methods.
Note that lazy loading will just work with an open JPA
EntityManager
, either within a managed transaction or within
OpenEntityManagerInViewFilter
/
OpenEntityManagerInViewInterceptor
.
Furthermore, some operations just make sense within transactions,
for example: flush
, clear
.
Public Methods
public
abstract
boolean
contains
(Object entity)
public
abstract
T
find
(Class<T> entityClass, Object id)
public
abstract
List
findByNamedQuery
(String queryName)
public
abstract
void
flush
()
public
abstract
T
getReference
(Class<T> entityClass, Object id)
public
abstract
T
merge
(T entity)
public
abstract
void
persist
(Object entity)
public
abstract
void
refresh
(Object entity)
public
abstract
void
remove
(Object entity)