Skip to content

Commit 33f53a2

Browse files
author
Thomas Darimont
committed
DATACMNS-577 - Improved javadoc on QueryDslPredicateExecutor.
Original pull request: #96.
1 parent 9bc334d commit 33f53a2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
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,27 +26,31 @@
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.
35+
* If the predicate yields more than one result a {@link IncorrectResultSizeDataAccessException} is thrown.
3336
*
34-
* @param spec
37+
* @param predicate
3538
* @return
3639
*/
3740
T findOne(Predicate predicate);
3841

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

4751
/**
4852
* Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s.
53+
* In case no match could be found an empty {@link Iterable} is returned.
4954
*
5055
* @param predicate
5156
* @param orders
@@ -55,6 +60,7 @@ public interface QueryDslPredicateExecutor<T> {
5560

5661
/**
5762
* Returns a {@link Page} of entities matching the given {@link Predicate}.
63+
* In case no match could be found, an empty {@link Page} is returned.
5864
*
5965
* @param predicate
6066
* @param pageable

0 commit comments

Comments
 (0)