Skip to content

Commit 1477c18

Browse files
committed
DATAJPA-790 - Polishing.
JavaDoc, formattgin, license years, author headers. Related tickets: DATAJPA-684 Original pull request: #182.
1 parent 3f5467d commit 1477c18

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/main/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected JPQLQuery<?> createQuery(Predicate... predicate) {
196196
/**
197197
* Creates a new {@link JPQLQuery} count query for the given {@link Predicate}.
198198
*
199-
* @param predicate
199+
* @param predicate, can be {@literal null}.
200200
* @return the Querydsl count {@link JPQLQuery}.
201201
*/
202202
protected JPQLQuery<?> createCountQuery(Predicate predicate) {

src/test/java/org/springframework/data/jpa/repository/EntityGraphRepositoryMethodsIntegrationTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2015 the original author or authors.
2+
* Copyright 2014-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@
4444
*
4545
* @author Thomas Darimont
4646
* @author Oliver Gierke
47+
* @author Jocelyn Ntakpe
4748
*/
4849
@RunWith(SpringJUnit4ClassRunner.class)
4950
@ContextConfiguration("classpath:config/namespace-autoconfig-context.xml")
@@ -137,12 +138,14 @@ public void shouldRespectDynamicFetchGraphForGetOneWithAttributeNamesById() {
137138
*/
138139
@Test
139140
public void shouldRespectConfiguredJpaEntityGraphWithPaginationAndQueryDslPredicates() {
141+
140142
Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em));
143+
141144
Page<User> page = repository.findAll(QUser.user.firstname.isNotNull(), new PageRequest(0, 100));
142145
List<User> result = page.getContent();
146+
143147
assertThat(result.size(), is(2));
144148
assertThat(Persistence.getPersistenceUtil().isLoaded(result.get(0).getRoles()), is(true));
145149
assertThat(result.get(0), is(tom));
146150
}
147-
148151
}

src/test/java/org/springframework/data/jpa/repository/sample/RepositoryMethodsWithEntityGraphConfigRepository.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2015 the original author or authors.
2+
* Copyright 2014-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
1717

1818
import java.util.List;
1919

20-
import com.querydsl.core.types.Predicate;
2120
import org.springframework.data.domain.Page;
2221
import org.springframework.data.domain.Pageable;
2322
import org.springframework.data.jpa.domain.sample.User;
@@ -26,14 +25,17 @@
2625
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
2726
import org.springframework.data.repository.CrudRepository;
2827

28+
import com.querydsl.core.types.Predicate;
29+
2930
/**
3031
* Custom repository interface that customizes the fetching behavior of querys of well known repository interface
3132
* methods via {@link EntityGraph} annotation.
3233
*
3334
* @author Thomas Darimont
3435
* @author Jocelyn Ntakpe
3536
*/
36-
public interface RepositoryMethodsWithEntityGraphConfigRepository extends CrudRepository<User, Integer>, QueryDslPredicateExecutor<User> {
37+
public interface RepositoryMethodsWithEntityGraphConfigRepository
38+
extends CrudRepository<User, Integer>, QueryDslPredicateExecutor<User> {
3739

3840
/**
3941
* Should find all users.
@@ -52,7 +54,7 @@ public interface RepositoryMethodsWithEntityGraphConfigRepository extends CrudRe
5254
*/
5355
@EntityGraph
5456
User getOneWithDefinedEntityGraphById(Integer id);
55-
57+
5658
/**
5759
* @see DATAJPA-696
5860
*/
@@ -62,6 +64,6 @@ public interface RepositoryMethodsWithEntityGraphConfigRepository extends CrudRe
6264
/**
6365
* @see DATAJPA-790
6466
*/
65-
@EntityGraph(type = EntityGraphType.FETCH, value = "User.detail")
67+
@EntityGraph("User.detail")
6668
Page<User> findAll(Predicate predicate, Pageable pageable);
6769
}

0 commit comments

Comments
 (0)