Polishing

(cherry picked from commit dc36bb34c7)
This commit is contained in:
Juergen Hoeller
2018-08-02 14:41:27 +02:00
parent ecf6c381be
commit f4c0421a7d
5 changed files with 94 additions and 34 deletions

View File

@@ -127,7 +127,7 @@ public abstract class SharedEntityManagerCreator {
/**
* Create a transactional EntityManager proxy for the given EntityManagerFactory.
* @param emf EntityManagerFactory to obtain EntityManagers from as needed
* @param emf the EntityManagerFactory to obtain EntityManagers from as needed
* @param properties the properties to be passed into the
* {@code createEntityManager} call (may be {@code null})
* @param entityManagerInterfaces the interfaces to be implemented by the
@@ -142,7 +142,7 @@ public abstract class SharedEntityManagerCreator {
/**
* Create a transactional EntityManager proxy for the given EntityManagerFactory.
* @param emf EntityManagerFactory to obtain EntityManagers from as needed
* @param emf the EntityManagerFactory to obtain EntityManagers from as needed
* @param properties the properties to be passed into the
* {@code createEntityManager} call (may be {@code null})
* @param synchronizedWithTransaction whether to automatically join ongoing
@@ -345,11 +345,11 @@ public abstract class SharedEntityManagerCreator {
private final Query target;
@Nullable
private EntityManager em;
private EntityManager entityManager;
public DeferredQueryInvocationHandler(Query target, EntityManager em) {
public DeferredQueryInvocationHandler(Query target, EntityManager entityManager) {
this.target = target;
this.em = em;
this.entityManager = entityManager;
}
@Override
@@ -387,8 +387,8 @@ public abstract class SharedEntityManagerCreator {
if (queryTerminatingMethods.contains(method.getName())) {
// Actual execution of the query: close the EntityManager right
// afterwards, since that was the only reason we kept it open.
EntityManagerFactoryUtils.closeEntityManager(this.em);
this.em = null;
EntityManagerFactoryUtils.closeEntityManager(this.entityManager);
this.entityManager = null;
}
}
}