DATACMNS-49 - Added integration for Spring Data named queries.
We now support extracting query definitions into a properties file which can be configured on the JpaRepositoryFactoryBean. The namespace will look for classpath*:META-INF/jpa-named-queries.properties by default.
This commit is contained in:
@@ -811,6 +811,17 @@ public class UserRepositoryTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void findsUsersBySpringDataNamedQuery() {
|
||||
|
||||
flushTestUsers();
|
||||
|
||||
List<User> result = repository.findBySpringDataNamedQuery("Gierke");
|
||||
assertThat(result.size(), is(1));
|
||||
assertThat(result, hasItem(firstUser));
|
||||
}
|
||||
|
||||
|
||||
private Page<User> executeSpecWithSort(Sort sort) {
|
||||
|
||||
flushTestUsers();
|
||||
|
||||
@@ -212,4 +212,7 @@ public interface UserRepository extends JpaRepository<User, Integer>,
|
||||
|
||||
|
||||
List<SpecialUser> findSpecialUsersByLastname(String lastname);
|
||||
|
||||
|
||||
List<User> findBySpringDataNamedQuery(String lastname);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user