You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2022/07/12 10:29:01 UTC
[cayenne] 02/02: CAY-2737 Cayenne 4.3: cleanup deprecated code - some more deprecated code deleted
This is an automated email from the ASF dual-hosted git repository.
ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 39b3345363857a30172b838041fb1c503e85112f
Author: Nikita Timofeev <st...@gmail.com>
AuthorDate: Tue Jul 12 13:28:47 2022 +0300
CAY-2737 Cayenne 4.3: cleanup deprecated code
- some more deprecated code deleted
---
.../cayenne/access/types/SubclassTypeFactory.java | 63 ----------------------
.../java/org/apache/cayenne/dba/JdbcAdapter.java | 21 --------
.../java/org/apache/cayenne/dba/TypesMapping.java | 11 ----
3 files changed, 95 deletions(-)
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/types/SubclassTypeFactory.java b/cayenne-server/src/main/java/org/apache/cayenne/access/types/SubclassTypeFactory.java
deleted file mode 100644
index 26e35a0a4..000000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/types/SubclassTypeFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ****************************************************************/
-package org.apache.cayenne.access.types;
-
-import org.apache.cayenne.util.Util;
-
-/**
- * A {@link ExtendedTypeFactory} that makes a {@link ExtendedType} usable for subclasses
- * of the className in the {@link ExtendedType}.
- *
- * @since 3.0
- * @deprecated since 4.1 it is unused, as this factory is faulty assuming that
- * we can freely interchange base class and it's subclasses.
- *
- */
-class SubclassTypeFactory implements ExtendedTypeFactory {
-
- private ExtendedType type;
- private Class<?> javaClass;
-
- SubclassTypeFactory(ExtendedType type) {
- this.type = type;
-
- try {
- javaClass = Util.getJavaClass(type.getClassName());
-
- // some classes that should not be handled here..
- if (javaClass.isArray()
- || javaClass.equals(Object.class)
- || javaClass.isPrimitive()) {
- javaClass = null;
- }
- } catch (ClassNotFoundException e) {
- // ignore.
- }
- }
-
- public ExtendedType getType(Class<?> objectClass) {
-
- if ((javaClass != null) && javaClass.isAssignableFrom(objectClass)) {
- return type;
- }
-
- return null;
- }
-
-}
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
index 8c250d6a3..479b9da6c 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
@@ -77,13 +77,6 @@ public class JdbcAdapter implements DbAdapter {
protected ResourceLocator resourceLocator;
protected boolean caseInsensitiveCollations;
- /**
- * @since 3.1
- * @deprecated since 4.0 BatchQueryBuilderfactory is attached to the DataNode.
- */
- @Inject
- protected BatchTranslatorFactory batchQueryBuilderFactory;
-
@Inject
protected JdbcEventLogger logger;
@@ -255,20 +248,6 @@ public class JdbcAdapter implements DbAdapter {
* @since 4.0
*/
public boolean typeSupportsLength(int type) {
- return JdbcAdapter.supportsLength(type);
- }
-
- /**
- * Returns true if supplied type can have a length attribute as a part of
- * column definition
- * <p/>
- * TODO: this is a static method only to support the deprecated method
- * {@link TypesMapping#supportsLength(int)} When the deprecated method is
- * removed this body should be moved in to {@link #typeSupportsLength(int)}
- *
- * @deprecated
- */
- static boolean supportsLength(int type) {
return type == Types.BINARY || type == Types.CHAR || type == Types.NCHAR || type == Types.NVARCHAR
|| type == Types.LONGNVARCHAR || type == Types.DECIMAL || type == Types.DOUBLE || type == Types.FLOAT
|| type == Types.NUMERIC || type == Types.REAL || type == Types.VARBINARY || type == Types.VARCHAR;
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/TypesMapping.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/TypesMapping.java
index f5ca84e68..695120981 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/TypesMapping.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/TypesMapping.java
@@ -272,17 +272,6 @@ public class TypesMapping {
JAVA_SQL_ENUM.put("boolean", BIT);
}
- /**
- * @deprecated
- *
- * Returns true if supplied type can have a length attribute as
- * a part of column definition.
- */
- public static boolean supportsLength(int type) {
- return JdbcAdapter.supportsLength(type);
- }
-
-
// TODO: redo all isXyz as an internal enum over types, where each enum object knows whether it is this or that kind
/**