mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
fixed uniqueResult implementation
This commit is contained in:
parent
72985d2657
commit
9cdfa2d45d
@ -148,7 +148,11 @@ public class MongodbQuery<K> implements SimpleQuery<MongodbQuery<K>>, SimpleProj
|
||||
|
||||
@Override
|
||||
public K uniqueResult() {
|
||||
DBCursor c = createCursor().limit(1);
|
||||
Long limit = queryMixin.getMetadata().getModifiers().getLimit();
|
||||
if (limit == null){
|
||||
limit = 2l;
|
||||
}
|
||||
DBCursor c = createCursor().limit(limit.intValue());
|
||||
if (c.hasNext()){
|
||||
K rv = transformer.transform(c.next());
|
||||
if (c.hasNext()){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user