java.lang.Object | ||
↳ | org.springframework.orm.jpa.EntityManagerFactoryAccessor | |
↳ | org.springframework.orm.jpa.JpaAccessor |
Known Direct Subclasses |
Base class for JpaTemplate and JpaInterceptor, defining common properties such as EntityManagerFactory and flushing behavior.
Not intended to be used directly.
See JpaTemplate
and JpaInterceptor
.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.orm.jpa.EntityManagerFactoryAccessor
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Eagerly initialize the JPA dialect, creating a default one
for the specified EntityManagerFactory if none set.
| |||||||||||
Return the JPA EntityManager to use.
| |||||||||||
Return the JPA dialect to use for this accessor.
| |||||||||||
Return if this accessor should flush changes to the database eagerly.
| |||||||||||
Set the JPA EntityManager to use.
| |||||||||||
Set if this accessor should flush changes to the database eagerly.
| |||||||||||
Set the JPA dialect to use for this accessor.
| |||||||||||
Convert the given runtime exception to an appropriate exception from the
org.springframework.dao hierarchy if necessary, or
return the exception itself if it is not persistence related
Default implementation delegates to the JpaDialect. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Flush the given JPA entity manager if necessary.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.orm.jpa.EntityManagerFactoryAccessor
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
|
Eagerly initialize the JPA dialect, creating a default one for the specified EntityManagerFactory if none set.
Return the JPA EntityManager to use.
Return the JPA dialect to use for this accessor.
Creates a default one for the specified EntityManagerFactory if none set.
Return if this accessor should flush changes to the database eagerly.
Set the JPA EntityManager to use.
Set if this accessor should flush changes to the database eagerly.
Eager flushing leads to immediate synchronization with the database, even if in a transaction. This causes inconsistencies to show up and throw a respective exception immediately, and JDBC access code that participates in the same transaction will see the changes as the database is already aware of them then. But the drawbacks are:
Set the JPA dialect to use for this accessor.
The dialect object can be used to retrieve the underlying JDBC connection, for example.
Convert the given runtime exception to an appropriate exception from the
org.springframework.dao
hierarchy if necessary, or
return the exception itself if it is not persistence related
Default implementation delegates to the JpaDialect. May be overridden in subclasses.
ex | runtime exception that occured, which may or may not be JPA-related |
---|
Flush the given JPA entity manager if necessary.
em | the current JPA PersistenceManage |
---|---|
existingTransaction | if executing within an existing transaction |
in case of JPA flushing errors | |
PersistenceException |