diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java index 646b7d0d3..93a1ca1f4 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java @@ -3787,7 +3787,9 @@ public String getSubqueryString(Subquery subquery) throws Exception { cfg.setPreparedValueList(new ArrayList<>()); String sql = (range == null || range.isEmpty() ? "" : range) + "(" + cfg.getSQL(isPrepared()) + ") "; - preparedValueList.addAll(cfg.getPreparedValueList()); + List origPreparedValueList = preparedValueList; + preparedValueList = cfg.getPreparedValueList(); + preparedValueList.addAll(origPreparedValueList); return sql; }