Skip to content

Commit 6ccffc6

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

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

+12-4
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,37 +15,44 @@
1515
*/
1616
package org.springframework.data.querydsl;
1717

18+
import java.util.List;
19+
1820
import org.springframework.data.domain.Page;
1921
import org.springframework.data.domain.Pageable;
2022

23+
import com.mysema.query.NonUniqueResultException;
2124
import com.mysema.query.types.OrderSpecifier;
2225
import com.mysema.query.types.Predicate;
2326

2427
/**
2528
* Interface to allow execution of QueryDsl {@link Predicate} instances.
2629
*
2730
* @author Oliver Gierke
31+
* @author Thomas Darimont
2832
*/
2933
public interface QueryDslPredicateExecutor<T> {
3034

3135
/**
32-
* Returns a single entity matching the given {@link Predicate}.
36+
* Returns a single entity matching the given {@link Predicate} or {@literal null} if none was found.
37+
* If the predicate yields more than one result a {@link NonUniqueResultException} is thrown.
3338
*
34-
* @param spec
39+
* @param predicate
3540
* @return
3641
*/
3742
T findOne(Predicate predicate);
3843

3944
/**
4045
* Returns all entities matching the given {@link Predicate}.
46+
* In case no match could be found an empty {@link List} is returned.
4147
*
42-
* @param spec
48+
* @param predicate
4349
* @return
4450
*/
4551
Iterable<T> findAll(Predicate predicate);
4652

4753
/**
4854
* Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s.
55+
* In case no match could be found an empty {@link List} is returned.
4956
*
5057
* @param predicate
5158
* @param orders
@@ -55,6 +62,7 @@ public interface QueryDslPredicateExecutor<T> {
5562

5663
/**
5764
* Returns a {@link Page} of entities matching the given {@link Predicate}.
65+
* In case no match could be found, a {@link Page} containing an empty {@link List} is returned.
5866
*
5967
* @param predicate
6068
* @param pageable

0 commit comments

Comments
 (0)