diff --git a/src/main/java/org/springframework/data/jpa/repository/Query.java b/src/main/java/org/springframework/data/jpa/repository/Query.java index 6a8a4bfe7..276466d33 100644 --- a/src/main/java/org/springframework/data/jpa/repository/Query.java +++ b/src/main/java/org/springframework/data/jpa/repository/Query.java @@ -23,7 +23,7 @@ import java.lang.annotation.Target; /** - * Annotation to declare finder queries directly on DAO methods. + * Annotation to declare finder queries directly on repository methods. * * @author Oliver Gierke */ diff --git a/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigDefinitionParser.java b/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigDefinitionParser.java index 77da48eef..e20092a7d 100644 --- a/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigDefinitionParser.java +++ b/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigDefinitionParser.java @@ -28,7 +28,7 @@ import org.w3c.dom.Element; /** - * Parser to create bean definitions for dao-config namespace. Registers bean + * Parser to create bean definitions for repositories namespace. Registers bean * definitions for repositories as well as * {@code PersistenceAnnotationBeanPostProcessor} and * {@code PersistenceExceptionTranslationPostProcessor} to transparently inject @@ -53,8 +53,9 @@ class JpaRepositoryConfigDefinitionParser /* * (non-Javadoc) * - * @see org.springframework.data.jpa.repository.config. - * AbstractRepositoryConfigDefinitionParser#getDaoConfigContext() + * @see org.springframework.data.repository.config. + * AbstractRepositoryConfigDefinitionParser + * #getGlobalRepositoryConfigInformation(org.w3c.dom.Element) */ @Override protected SimpleJpaRepositoryConfiguration getGlobalRepositoryConfigInformation( diff --git a/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryNameSpaceHandler.java b/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryNameSpaceHandler.java index 1bd468f8f..59b0f1ad3 100644 --- a/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryNameSpaceHandler.java +++ b/src/main/java/org/springframework/data/jpa/repository/config/JpaRepositoryNameSpaceHandler.java @@ -20,7 +20,7 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** - * Simple namespace handler for {@literal dao-config} namespace. + * Simple namespace handler for {@literal repositories} namespace. * * @author Oliver Gierke */ diff --git a/src/main/java/org/springframework/data/jpa/repository/config/SimpleJpaRepositoryConfiguration.java b/src/main/java/org/springframework/data/jpa/repository/config/SimpleJpaRepositoryConfiguration.java index f022ca655..dec8c0c61 100644 --- a/src/main/java/org/springframework/data/jpa/repository/config/SimpleJpaRepositoryConfiguration.java +++ b/src/main/java/org/springframework/data/jpa/repository/config/SimpleJpaRepositoryConfiguration.java @@ -98,7 +98,7 @@ public class SimpleJpaRepositoryConfiguration /** * Returns the {@link javax.persistence.EntityManagerFactory} reference - * to be used for all the DAO instances configured. + * to be used for all the repository instances configured. * * @return */ diff --git a/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java b/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java index c78b359d0..8043695a4 100644 --- a/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java +++ b/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java @@ -43,7 +43,7 @@ import org.springframework.transaction.annotation.Transactional; public class AuditingEntityListenerTests { @Autowired - AuditableUserRepository dao; + AuditableUserRepository repository; @Autowired AuditorAwareStub auditorAware; @@ -57,7 +57,7 @@ public class AuditingEntityListenerTests { user = new AuditableUser(); auditorAware.setAuditor(user); - dao.save(user); + repository.save(user); } @@ -76,7 +76,7 @@ public class AuditingEntityListenerTests { role.setName("ADMIN"); user.addRole(role); - dao.save(user); + repository.save(user); role = user.getRoles().iterator().next(); assertDatesSet(user); diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserDaoTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java similarity index 91% rename from src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserDaoTests.java rename to src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java index 1d336d481..7945463a9 100644 --- a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserDaoTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java @@ -25,6 +25,6 @@ import org.springframework.test.context.ContextConfiguration; * @author Oliver Gierke */ @ContextConfiguration(value = "classpath:openjpa.xml", inheritLocations = true) -public class OpenJpaNamespaceUserDaoTests extends NamespaceUserRepositoryTests { +public class OpenJpaNamespaceUserRepositoryTests extends NamespaceUserRepositoryTests { } \ No newline at end of file diff --git a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java index 79714056c..96062fd23 100644 --- a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java @@ -85,8 +85,8 @@ public class UserRepositoryFinderTests { /** - * Tests that the DAO returns {@code null} for not found objects for finder - * methods that return a single domain object. + * Tests that the repository returns {@code null} for not found objects for + * finder methods that return a single domain object. */ @Test public void returnsNullIfNothingFound() { diff --git a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java index ba6c26d21..621104f53 100644 --- a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java @@ -326,7 +326,7 @@ public class UserRepositoryTests { /** * Tests that all users get deleted by triggering - * {@link UserDao#deleteAll()}. + * {@link UserRepository#deleteAll()}. * * @throws Exception */ @@ -398,7 +398,7 @@ public class UserRepositoryTests { /** - * Tests, that the generic dao implements count correctly. + * Tests, that the generic repository implements count correctly. */ @Test public void testCountsCorrectly() { @@ -414,7 +414,8 @@ public class UserRepositoryTests { /** - * Tests invoking a method of a custom implementation of the DAO interface. + * Tests invoking a method of a custom implementation of the repository + * interface. */ @Test public void testInvocationOfCustomImplementation() { @@ -424,7 +425,7 @@ public class UserRepositoryTests { /** - * Tests that overriding a finder method is recognized by the DAO + * Tests that overriding a finder method is recognized by the repository * implementation. If an overriding method is found it will will be invoked * instead of the automatically generated finder. */ diff --git a/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java index af9df8702..53930a76b 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java @@ -45,7 +45,7 @@ public abstract class AbstractRepositoryConfigTests { /** - * Asserts that context creation detects 3 DAO beans. + * Asserts that context creation detects 3 repository beans. */ @Test public void testContextCreation() { diff --git a/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java index 2c116bfbf..5556aa791 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/CustomRepositoryFactoryConfigTests.java @@ -25,14 +25,14 @@ import org.springframework.util.Assert; /** - * Annotation to exclude DAO interfaces from being picked up and thus in + * Annotation to exclude repository interfaces from being picked up and thus in * consequence getting an instance being created. *
* This will typically be used when providing an extended base interface for all
- * DAOs in combination with a custom DAO base class to implement methods
- * declared in that intermediate interface. In this case you typically derive
- * your concrete DAO interfaces from the intermediate one but don't want to
- * create a Spring bean for the intermediate interface.
+ * repositories in combination with a custom repository base class to implement
+ * methods declared in that intermediate interface. In this case you typically
+ * derive your concrete repository interfaces from the intermediate one but
+ * don't want to create a Spring bean for the intermediate interface.
*
* @author Oliver Gierke
*/
diff --git a/src/test/java/org/springframework/data/jpa/repository/config/RepositoryAutoConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/RepositoryAutoConfigTests.java
index 3733e3ba5..d716e14d9 100644
--- a/src/test/java/org/springframework/data/jpa/repository/config/RepositoryAutoConfigTests.java
+++ b/src/test/java/org/springframework/data/jpa/repository/config/RepositoryAutoConfigTests.java
@@ -20,7 +20,7 @@ import org.springframework.test.context.ContextConfiguration;
/**
- * Integration test to test DAO auto configuration.
+ * Integration test to test repository auto configuration.
*
* @author Oliver Gierke
*/
diff --git a/src/test/java/org/springframework/data/jpa/repository/config/RepositoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/RepositoryConfigTests.java
index 72a6fa34d..6f6b600a4 100644
--- a/src/test/java/org/springframework/data/jpa/repository/config/RepositoryConfigTests.java
+++ b/src/test/java/org/springframework/data/jpa/repository/config/RepositoryConfigTests.java
@@ -19,7 +19,7 @@ import org.springframework.test.context.ContextConfiguration;
/**
- * Integration test for DAO namespace configuration.
+ * Integration test for repository namespace configuration.
*
* @author Oliver Gierke
*/
diff --git a/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepository.java b/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepository.java
index f5e733c25..421bb47bb 100644
--- a/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepository.java
+++ b/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepository.java
@@ -24,8 +24,8 @@ import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
/**
- * Sample custom DAO base class implementing common custom functionality for all
- * derived DAO instances.
+ * Sample custom repository base class implementing common custom functionality
+ * for all derived repository instances.
*
* @author Oliver Gierke
*/
diff --git a/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepositoryFactoryBean.java b/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepositoryFactoryBean.java
index a1bcde25c..e2b6c01d3 100644
--- a/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepositoryFactoryBean.java
+++ b/src/test/java/org/springframework/data/jpa/repository/custom/CustomGenericJpaRepositoryFactoryBean.java
@@ -24,7 +24,7 @@ import org.springframework.data.repository.support.RepositoryFactorySupport;
/**
- * {@link GenericDaoFactoryBean} to return a custom DAO base class.
+ * {@link JpaRepositoryFactoryBean} to return a custom repository base class.
*
* @author Gil Markham
* @author Oliver Gierke
diff --git a/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java b/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java
index 8042e2de8..723786422 100644
--- a/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java
+++ b/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java
@@ -20,8 +20,8 @@ import org.springframework.data.jpa.domain.sample.User;
/**
- * Custom Extended DAO interface for a {@code User}. This relies on the custom
- * intermediate DAO interface {@link CustomGenericRepository}.
+ * Custom Extended repository interface for a {@code User}. This relies on the
+ * custom intermediate repository interface {@link CustomGenericRepository}.
*
* @author Oliver Gierke
*/
diff --git a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java
index 8b30066d9..102eb1dd6 100644
--- a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java
+++ b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java
@@ -56,7 +56,7 @@ public class JpaQueryMethodUnitTests {
@Mock
EntityManager em;
- Method daoMethod, invalidReturnType, pageableAndSort, pageableTwice,
+ Method repositoryMethod, invalidReturnType, pageableAndSort, pageableTwice,
sortableTwice, modifyingMethod;
@@ -66,21 +66,21 @@ public class JpaQueryMethodUnitTests {
@Before
public void setUp() throws Exception {
- daoMethod =
+ repositoryMethod =
UserRepository.class.getMethod("findByLastname", String.class);
invalidReturnType =
- InvalidDao.class.getMethod(METHOD_NAME, String.class,
+ InvalidRepository.class.getMethod(METHOD_NAME, String.class,
Pageable.class);
pageableAndSort =
- InvalidDao.class.getMethod(METHOD_NAME, String.class,
+ InvalidRepository.class.getMethod(METHOD_NAME, String.class,
Pageable.class, Sort.class);
pageableTwice =
- InvalidDao.class.getMethod(METHOD_NAME, String.class,
+ InvalidRepository.class.getMethod(METHOD_NAME, String.class,
Pageable.class, Pageable.class);
sortableTwice =
- InvalidDao.class.getMethod(METHOD_NAME, String.class,
+ InvalidRepository.class.getMethod(METHOD_NAME, String.class,
Sort.class, Sort.class);
modifyingMethod =
UserRepository.class
@@ -91,7 +91,8 @@ public class JpaQueryMethodUnitTests {
@Test
public void testname() {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
assertEquals("User.findByLastname", method.getNamedQueryName());
assertThat(method.getExecution(), is(CollectionExecution.class));
@@ -99,7 +100,7 @@ public class JpaQueryMethodUnitTests {
@Test(expected = IllegalArgumentException.class)
- public void preventsNullDaoMethod() {
+ public void preventsNullRepositoryMethod() {
new JpaQueryMethod(null, extractor, em);
}
@@ -108,37 +109,39 @@ public class JpaQueryMethodUnitTests {
@Test(expected = IllegalArgumentException.class)
public void preventsNullEntityManager() {
- new JpaQueryMethod(daoMethod, extractor, null);
+ new JpaQueryMethod(repositoryMethod, extractor, null);
}
@Test(expected = IllegalArgumentException.class)
public void preventsNullQueryExtractor() {
- new JpaQueryMethod(daoMethod, null, em);
+ new JpaQueryMethod(repositoryMethod, null, em);
}
@Test
public void returnsCorrectName() {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
- assertEquals(daoMethod.getName(), method.getName());
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
+ assertEquals(repositoryMethod.getName(), method.getName());
}
@Test
public void returnsQueryIfAvailable() throws Exception {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
assertNull(method.getAnnotatedQuery());
- Method daoMethod =
+ Method repositoryMethod =
UserRepository.class.getMethod("findByAnnotatedQuery",
String.class);
- assertNotNull(new JpaQueryMethod(daoMethod, extractor, em)
+ assertNotNull(new JpaQueryMethod(repositoryMethod, extractor, em)
.getAnnotatedQuery());
}
@@ -146,7 +149,8 @@ public class JpaQueryMethodUnitTests {
@Test
public void returnsCorrectDomainClassName() {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
assertEquals(DOMAIN_CLASS, method.getDomainClass());
}
@@ -154,8 +158,9 @@ public class JpaQueryMethodUnitTests {
@Test
public void returnsCorrectNumberOfParameters() {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
- assertTrue(method.isCorrectNumberOfParameters(daoMethod
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
+ assertTrue(method.isCorrectNumberOfParameters(repositoryMethod
.getParameterTypes().length));
}
@@ -215,7 +220,7 @@ public class JpaQueryMethodUnitTests {
public void rejectsModifyingMethodWithPageable() throws Exception {
Method method =
- InvalidDao.class.getMethod("updateMethod", String.class,
+ InvalidRepository.class.getMethod("updateMethod", String.class,
Pageable.class);
new JpaQueryMethod(method, extractor, em);
@@ -226,7 +231,7 @@ public class JpaQueryMethodUnitTests {
public void rejectsModifyingMethodWithSort() throws Exception {
Method method =
- InvalidDao.class.getMethod("updateMethod", String.class,
+ InvalidRepository.class.getMethod("updateMethod", String.class,
Sort.class);
new JpaQueryMethod(method, extractor, em);
@@ -236,7 +241,8 @@ public class JpaQueryMethodUnitTests {
@Test
public void discoversHintsCorrectly() {
- JpaQueryMethod method = new JpaQueryMethod(daoMethod, extractor, em);
+ JpaQueryMethod method =
+ new JpaQueryMethod(repositoryMethod, extractor, em);
List
* TODO: Check if test methods double the ones in
* {@link JpaRepositoryFactoryUnitTests}.
@@ -80,7 +80,7 @@ public class JpaRepositoryFactoryBeanUnitTests {
/**
* Assert that the instance created for the standard configuration is a
- * valid {@code UserDao}.
+ * valid {@code UserRepository}.
*
* @throws Exception
*/
@@ -103,22 +103,23 @@ public class JpaRepositoryFactoryBeanUnitTests {
/**
* Assert that the factory rejects calls to
- * {@code GenericDaoFactoryBean#setDaoInterface(Class)} with {@code null} or
- * any other parameter instance not implementing {@code GenericDao}.
+ * {@code JpaRepositoryFactoryBean#setRepositoryInterface(Class)} with
+ * {@literal null} or any other parameter instance not implementing
+ * {@code Repository}.
*/
@Test(expected = IllegalArgumentException.class)
- public void preventsNullDaoInterface() {
+ public void preventsNullRepositoryInterface() {
factory.setRepositoryInterface(null);
}
/**
- * Assert that the factory detects unset DAO class and interface in
- * {@code GenericDaoFactoryBean#afterPropertiesSet()}.
+ * Assert that the factory detects unset repository class and interface in
+ * {@code JpaRepositoryFactoryBean#afterPropertiesSet()}.
*/
@Test(expected = IllegalArgumentException.class)
- public void preventsUnsetDaoInterface() throws Exception {
+ public void preventsUnsetRepositoryInterface() throws Exception {
factory = new JpaRepositoryFactoryBean