mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Potential Fix for using idEq or setId in subquery
This commit is contained in:
@@ -21,10 +21,7 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
@@ -303,7 +300,20 @@ public final class CQueryPredicates {
|
||||
* Return the bind values for the where expression.
|
||||
*/
|
||||
public List<Object> whereExprBindValues() {
|
||||
return where == null ? Collections.emptyList() : where.bindValues();
|
||||
if (idValue == null && where == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (where == null) {
|
||||
return List.of(idValue);
|
||||
}
|
||||
if (idValue == null) {
|
||||
return where.bindValues();
|
||||
}
|
||||
|
||||
List<Object> bindValues = new ArrayList<>();
|
||||
bindValues.add(idValue);
|
||||
bindValues.addAll(where.bindValues());
|
||||
return Collections.unmodifiableList(bindValues);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user