mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-27 21:01:15 +08:00
commit
bb3fed6609
@ -195,7 +195,7 @@ public final class CollQueryFunctions {
|
||||
}
|
||||
|
||||
public static <T> Collection<T> leftJoin(Collection<T> coll) {
|
||||
if (coll.isEmpty()) {
|
||||
if (coll == null || coll.isEmpty()) {
|
||||
@SuppressWarnings("unchecked") // List only contains null
|
||||
Collection<T> rv = (Collection<T>) nullList;
|
||||
return rv;
|
||||
|
||||
@ -9,6 +9,15 @@ import org.junit.Test;
|
||||
|
||||
public class CollectionAnyTest extends AbstractQueryTest {
|
||||
|
||||
@Test
|
||||
public void any_null() {
|
||||
Cat a = new Cat("a");
|
||||
a.setKittens(null);
|
||||
|
||||
assertEquals(0, CollQueryFactory.from(cat, Arrays.asList(a))
|
||||
.where(cat.kittens.any().name.startsWith("a")).fetchCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void any_in_projection() {
|
||||
Cat a = new Cat("a");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user