Merge pull request #2765 from ebean-orm/feature/2762-forUpdate-pagingList-count

#2762 - forUpdate is NOT included in query copy() method
This commit is contained in:
Rob Bygrave authored and GitHub committed 2022-08-03 20:35:45 +12:00
commit a14507e563
3 files changed
+28 -2

No files matched your search

@@ -417,6 +417,8 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
/**
* Return a copy of the query.
* <p>
* Note that this does NOT copy the forUpdate property. See #2762.
*/
@Override
SpiQuery<T> copy();
@@ -708,6 +708,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
@Override
public SpiQuery<T> copy(SpiEbeanServer server) {
// forUpdate is NOT copied - see #2762
DefaultOrmQuery<T> copy = new DefaultOrmQuery<>(beanDescriptor, server, expressionFactory);
copy.transaction = transaction;
copy.m2mIncludeJoin = m2mIncludeJoin;
@@ -748,7 +749,6 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
copy.usageProfiling = usageProfiling;
copy.autoTune = autoTune;
copy.parentNode = parentNode;
copy.forUpdate = forUpdate;
copy.rawSql = rawSql;
setCancelableQuery(copy); // required to cancel findId query
return copy;