You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2026/07/03 20:18:41 UTC
(cayenne) 01/02: cleanup
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 5756c1871f1cd3aa2eb03e5ce5a6a1a9f7e223b9
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Fri Jul 3 15:47:34 2026 -0400
cleanup
---
.../org/apache/cayenne/access/DeferredValue.java | 3 +-
.../access/flush/ObjectIdValueSupplier.java | 7 ++---
.../java/org/apache/cayenne/query/BatchQuery.java | 8 ------
.../org/apache/cayenne/query/UpdateBatchQuery.java | 33 ++++------------------
4 files changed, 11 insertions(+), 40 deletions(-)
diff --git a/cayenne/src/main/java/org/apache/cayenne/access/DeferredValue.java b/cayenne/src/main/java/org/apache/cayenne/access/DeferredValue.java
index 36cd446cb..948e0a9c4 100644
--- a/cayenne/src/main/java/org/apache/cayenne/access/DeferredValue.java
+++ b/cayenne/src/main/java/org/apache/cayenne/access/DeferredValue.java
@@ -20,6 +20,7 @@
package org.apache.cayenne.access;
import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.access.types.InternalUnsupportedTypeFactory;
/**
* A value that is not known until a preceding row of the same transaction has been executed, e.g. a generated PK
@@ -29,7 +30,7 @@ import org.apache.cayenne.CayenneRuntimeException;
* @since 5.0
*/
@FunctionalInterface
-public interface DeferredValue {
+public interface DeferredValue extends InternalUnsupportedTypeFactory.Marker {
int MAX_NESTED_LEVEL = 1000;
diff --git a/cayenne/src/main/java/org/apache/cayenne/access/flush/ObjectIdValueSupplier.java b/cayenne/src/main/java/org/apache/cayenne/access/flush/ObjectIdValueSupplier.java
index 7eda79d63..07a63ce39 100644
--- a/cayenne/src/main/java/org/apache/cayenne/access/flush/ObjectIdValueSupplier.java
+++ b/cayenne/src/main/java/org/apache/cayenne/access/flush/ObjectIdValueSupplier.java
@@ -19,18 +19,17 @@
package org.apache.cayenne.access.flush;
-import java.util.Objects;
-
import org.apache.cayenne.ObjectId;
import org.apache.cayenne.access.DeferredValue;
-import org.apache.cayenne.access.types.InternalUnsupportedTypeFactory;
+
+import java.util.Objects;
/**
* Deferred value extracted from ObjectId
*
* @since 4.2
*/
-class ObjectIdValueSupplier implements DeferredValue, InternalUnsupportedTypeFactory.Marker {
+class ObjectIdValueSupplier implements DeferredValue {
private final ObjectId id;
private final String attribute;
diff --git a/cayenne/src/main/java/org/apache/cayenne/query/BatchQuery.java b/cayenne/src/main/java/org/apache/cayenne/query/BatchQuery.java
index b7c96ba4f..43cff829b 100644
--- a/cayenne/src/main/java/org/apache/cayenne/query/BatchQuery.java
+++ b/cayenne/src/main/java/org/apache/cayenne/query/BatchQuery.java
@@ -35,16 +35,8 @@ import java.util.List;
*/
public abstract class BatchQuery implements Query {
- /**
- * @since 1.2
- */
protected DbEntity dbEntity;
-
- /**
- * @since 4.0
- */
protected List<BatchQueryRow> rows;
-
protected List<DbAttribute> dbAttributes;
/**
diff --git a/cayenne/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java b/cayenne/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java
index f3ddd65fe..210738337 100644
--- a/cayenne/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java
+++ b/cayenne/src/main/java/org/apache/cayenne/query/UpdateBatchQuery.java
@@ -36,33 +36,17 @@ public class UpdateBatchQuery extends BatchQuery {
protected boolean usingOptimisticLocking;
- private List<DbAttribute> updatedAttributes;
- private List<DbAttribute> qualifierAttributes;
- private Collection<String> nullQualifierNames;
-
- private static List<DbAttribute> toDbAttributes(List<DbAttribute> qualifierAttributes,
- List<DbAttribute> updatedAttributes) {
- List<DbAttribute> dbAttributes = new ArrayList<>(updatedAttributes.size()
- + qualifierAttributes.size());
+ private final List<DbAttribute> updatedAttributes;
+ private final List<DbAttribute> qualifierAttributes;
+ private final Collection<String> nullQualifierNames;
+
+ private static List<DbAttribute> toDbAttributes(List<DbAttribute> qualifierAttributes, List<DbAttribute> updatedAttributes) {
+ List<DbAttribute> dbAttributes = new ArrayList<>(updatedAttributes.size() + qualifierAttributes.size());
dbAttributes.addAll(updatedAttributes);
dbAttributes.addAll(qualifierAttributes);
return dbAttributes;
}
- /**
- * Creates new UpdateBatchQuery.
- *
- * @param dbEntity
- * Table or view to update.
- * @param qualifierAttributes
- * DbAttributes used in the WHERE clause.
- * @param nullQualifierNames
- * DbAttribute names in the WHERE clause that have null values.
- * @param updatedAttributes
- * DbAttributes describing updated columns.
- * @param batchCapacity
- * Estimated size of the batch.
- */
public UpdateBatchQuery(DbEntity dbEntity, List<DbAttribute> qualifierAttributes,
List<DbAttribute> updatedAttributes, Collection<String> nullQualifierNames, int batchCapacity) {
@@ -126,11 +110,6 @@ public class UpdateBatchQuery extends BatchQuery {
});
}
- @Override
- public List<DbAttribute> getDbAttributes() {
- return dbAttributes;
- }
-
/**
* @since 1.1
*/