Browse Source

Fix and improve Javadoc in spring-orm

See gh-28796
pull/28850/head
Marc Wrobel 3 years ago committed by Sam Brannen
parent
commit
ac06d1dfa9
  1. 2
      spring-orm/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java
  2. 4
      spring-orm/src/main/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java
  3. 4
      spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerFactoryAccessor.java
  4. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerProxy.java
  5. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/ExtendedEntityManagerCreator.java
  6. 4
      spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java
  7. 2
      spring-orm/src/main/java/org/springframework/orm/jpa/JpaVendorAdapter.java
  8. 6
      spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java
  9. 6
      spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java
  10. 2
      spring-orm/src/test/java/org/springframework/orm/jpa/domain/Person.java

2
spring-orm/src/main/java/org/springframework/orm/hibernate5/support/OpenSessionInViewInterceptor.java

@ -142,7 +142,7 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
} }
/** /**
* Unbind the Hibernate {@code Session} from the thread and close it). * Unbind the Hibernate {@code Session} from the thread and close it.
* @see TransactionSynchronizationManager * @see TransactionSynchronizationManager
*/ */
@Override @Override

4
spring-orm/src/main/java/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java

@ -218,10 +218,10 @@ public abstract class AbstractEntityManagerFactoryBean implements
} }
/** /**
* Allow Map access to the JPA properties to be passed to the persistence * Allow {@code Map} access to the JPA properties to be passed to the persistence
* provider, with the option to add or override specific entries. * provider, with the option to add or override specific entries.
* <p>Useful for specifying entries directly, for example via * <p>Useful for specifying entries directly, for example via
* "jpaPropertyMap[myKey]". * {@code jpaPropertyMap[myKey]}.
*/ */
public Map<String, Object> getJpaPropertyMap() { public Map<String, Object> getJpaPropertyMap() {
return this.jpaPropertyMap; return this.jpaPropertyMap;

4
spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerFactoryAccessor.java

@ -131,9 +131,9 @@ public abstract class EntityManagerFactoryAccessor implements BeanFactoryAware {
} }
/** /**
* Allow Map access to the JPA properties to be passed to the persistence * Allow {@code Map} access to the JPA properties to be passed to the persistence
* provider, with the option to add or override specific entries. * provider, with the option to add or override specific entries.
* <p>Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]". * <p>Useful for specifying entries directly, for example via {@code jpaPropertyMap[myKey]}.
*/ */
public Map<String, Object> getJpaPropertyMap() { public Map<String, Object> getJpaPropertyMap() {
return this.jpaPropertyMap; return this.jpaPropertyMap;

2
spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerProxy.java

@ -37,7 +37,7 @@ public interface EntityManagerProxy extends EntityManager {
* raw EntityManager. * raw EntityManager.
* <p>In case of a shared ("transactional") EntityManager, this will be * <p>In case of a shared ("transactional") EntityManager, this will be
* the raw EntityManager that is currently associated with the transaction. * the raw EntityManager that is currently associated with the transaction.
* Outside of a transaction, an IllegalStateException will be thrown. * Outside a transaction, an IllegalStateException will be thrown.
* @return the underlying raw EntityManager (never {@code null}) * @return the underlying raw EntityManager (never {@code null})
* @throws IllegalStateException if no underlying EntityManager is available * @throws IllegalStateException if no underlying EntityManager is available
*/ */

2
spring-orm/src/main/java/org/springframework/orm/jpa/ExtendedEntityManagerCreator.java

@ -50,7 +50,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
* Delegate for creating a variety of {@link javax.persistence.EntityManager} * Delegate for creating a variety of {@link javax.persistence.EntityManager}
* proxies that follow the JPA spec's semantics for "extended" EntityManagers. * proxies that follow the JPA spec's semantics for "extended" EntityManagers.
* *
* <p>Supports several different variants of "extended" EntityManagers: * <p>Supports several variants of "extended" EntityManagers:
* in particular, an "application-managed extended EntityManager", as defined * in particular, an "application-managed extended EntityManager", as defined
* by {@link javax.persistence.EntityManagerFactory#createEntityManager()}, * by {@link javax.persistence.EntityManagerFactory#createEntityManager()},
* as well as a "container-managed extended EntityManager", as defined by * as well as a "container-managed extended EntityManager", as defined by

4
spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java

@ -228,9 +228,9 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
} }
/** /**
* Allow Map access to the JPA properties to be passed to the persistence * Allow {@code Map} access to the JPA properties to be passed to the persistence
* provider, with the option to add or override specific entries. * provider, with the option to add or override specific entries.
* <p>Useful for specifying entries directly, for example via "jpaPropertyMap[myKey]". * <p>Useful for specifying entries directly, for example via {@code jpaPropertyMap[myKey]}.
*/ */
public Map<String, Object> getJpaPropertyMap() { public Map<String, Object> getJpaPropertyMap() {
return this.jpaPropertyMap; return this.jpaPropertyMap;

2
spring-orm/src/main/java/org/springframework/orm/jpa/JpaVendorAdapter.java

@ -66,7 +66,7 @@ public interface JpaVendorAdapter {
* to unit-specific characteristics such as the transaction type. * to unit-specific characteristics such as the transaction type.
* <p><b>NOTE:</b> This variant will only be invoked in case of Java EE style * <p><b>NOTE:</b> This variant will only be invoked in case of Java EE style
* container bootstrapping where a {@link PersistenceUnitInfo} is present * container bootstrapping where a {@link PersistenceUnitInfo} is present
* (i.e. {@link LocalContainerEntityManagerFactoryBean}. In case of simple * (i.e. {@link LocalContainerEntityManagerFactoryBean}). In case of simple
* Java SE style bootstrapping via {@link javax.persistence.Persistence} * Java SE style bootstrapping via {@link javax.persistence.Persistence}
* (i.e. {@link LocalEntityManagerFactoryBean}), the parameter-less * (i.e. {@link LocalEntityManagerFactoryBean}), the parameter-less
* {@link #getJpaPropertyMap()} variant will be called directly. * {@link #getJpaPropertyMap()} variant will be called directly.

6
spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java

@ -119,7 +119,7 @@ public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEnt
doInstantiateAndSave(em); doInstantiateAndSave(em);
setComplete(); setComplete();
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1); assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1);
// Now clean up the database // Now clean up the database
@ -139,7 +139,7 @@ public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEnt
EntityManager em = entityManagerFactory.createEntityManager(); EntityManager em = entityManagerFactory.createEntityManager();
em.joinTransaction(); em.joinTransaction();
doInstantiateAndSave(em); doInstantiateAndSave(em);
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have been rolled back").isEqualTo(0); assertThat(countRowsInTable(em, "person")).as("Tx must have been rolled back").isEqualTo(0);
} }
@ -150,7 +150,7 @@ public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEnt
doInstantiateAndSave(em); doInstantiateAndSave(em);
setComplete(); setComplete();
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1); assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1);
// Now clean up the database // Now clean up the database

6
spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java

@ -139,7 +139,7 @@ public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntit
doInstantiateAndSave(em); doInstantiateAndSave(em);
setComplete(); setComplete();
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1); assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1);
// Now clean up the database // Now clean up the database
@ -150,7 +150,7 @@ public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntit
public void testRollbackOccurs() { public void testRollbackOccurs() {
EntityManager em = createContainerManagedEntityManager(); EntityManager em = createContainerManagedEntityManager();
doInstantiateAndSave(em); doInstantiateAndSave(em);
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have been rolled back").isEqualTo(0); assertThat(countRowsInTable(em, "person")).as("Tx must have been rolled back").isEqualTo(0);
} }
@ -159,7 +159,7 @@ public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntit
EntityManager em = createContainerManagedEntityManager(); EntityManager em = createContainerManagedEntityManager();
doInstantiateAndSave(em); doInstantiateAndSave(em);
setComplete(); setComplete();
endTransaction(); // Should rollback endTransaction(); // Should roll back
assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1); assertThat(countRowsInTable(em, "person")).as("Tx must have committed back").isEqualTo(1);
// Now clean up the database // Now clean up the database

2
spring-orm/src/test/java/org/springframework/orm/jpa/domain/Person.java

@ -31,7 +31,7 @@ import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
/** /**
* Simple JavaBean domain object representing an person. * Simple JavaBean domain object representing a person.
* *
* @author Rod Johnson * @author Rod Johnson
*/ */

Loading…
Cancel
Save