Skip to content

Commit 47e2c84

Browse files
Thomas Darimontodrotbohm
Thomas Darimont
authored andcommitted
DATACMNS-577 - Improved JavaDoc on QueryDslPredicateExecutor.
Clarified return values if predicates don't match or return multiple results (for the findOne(…) method). Copied summary to the @return tag. Original pull request: #96.
1 parent 4942210 commit 47e2c84

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/main/java/org/springframework/data/querydsl/QueryDslPredicateExecutor.java

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011 the original author or authors.
2+
* Copyright 2011-2014 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.
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.data.querydsl;
1717

18+
import org.springframework.dao.IncorrectResultSizeDataAccessException;
1819
import org.springframework.data.domain.Page;
1920
import org.springframework.data.domain.Pageable;
2021

@@ -25,40 +26,45 @@
2526
* Interface to allow execution of QueryDsl {@link Predicate} instances.
2627
*
2728
* @author Oliver Gierke
29+
* @author Thomas Darimont
2830
*/
2931
public interface QueryDslPredicateExecutor<T> {
3032

3133
/**
32-
* Returns a single entity matching the given {@link Predicate}.
34+
* Returns a single entity matching the given {@link Predicate} or {@literal null} if none was found.
3335
*
34-
* @param spec
35-
* @return
36+
* @param predicate
37+
* @return a single entity matching the given {@link Predicate} or {@literal null} if none was found.
38+
* @throws IncorrectResultSizeDataAccessException if the predicate yields more than one result.
3639
*/
3740
T findOne(Predicate predicate);
3841

3942
/**
40-
* Returns all entities matching the given {@link Predicate}.
43+
* Returns all entities matching the given {@link Predicate}. In case no match could be found an empty
44+
* {@link Iterable} is returned.
4145
*
42-
* @param spec
43-
* @return
46+
* @param predicate
47+
* @return all entities matching the given {@link Predicate}.
4448
*/
4549
Iterable<T> findAll(Predicate predicate);
4650

4751
/**
48-
* Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s.
52+
* Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. In case no
53+
* match could be found an empty {@link Iterable} is returned.
4954
*
5055
* @param predicate
5156
* @param orders
52-
* @return
57+
* @return all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s.
5358
*/
5459
Iterable<T> findAll(Predicate predicate, OrderSpecifier<?>... orders);
5560

5661
/**
57-
* Returns a {@link Page} of entities matching the given {@link Predicate}.
62+
* Returns a {@link Page} of entities matching the given {@link Predicate}. In case no match could be found, an empty
63+
* {@link Page} is returned.
5864
*
5965
* @param predicate
6066
* @param pageable
61-
* @return
67+
* @return a {@link Page} of entities matching the given {@link Predicate}.
6268
*/
6369
Page<T> findAll(Predicate predicate, Pageable pageable);
6470

0 commit comments

Comments
 (0)