From 08880609bf6841a88171803c465c6e247bed5f5d Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 20 Sep 2024 13:32:06 +0200 Subject: [PATCH] delete all APIs marked for removal in 4.0 Signed-off-by: Gavin King --- .../java/jakarta/persistence/EntityGraph.java | 18 +------ .../main/java/jakarta/persistence/Graph.java | 54 ------------------- .../java/jakarta/persistence/Persistence.java | 30 +---------- .../persistence/spi/PersistenceUnitInfo.java | 2 + .../spi/PersistenceUnitTransactionType.java | 37 ------------- .../ch09-container-provider-contracts.adoc | 6 +-- 6 files changed, 8 insertions(+), 139 deletions(-) delete mode 100644 api/src/main/java/jakarta/persistence/spi/PersistenceUnitTransactionType.java diff --git a/api/src/main/java/jakarta/persistence/EntityGraph.java b/api/src/main/java/jakarta/persistence/EntityGraph.java index 16444418..c1feae0f 100644 --- a/api/src/main/java/jakarta/persistence/EntityGraph.java +++ b/api/src/main/java/jakarta/persistence/EntityGraph.java @@ -64,21 +64,5 @@ public interface EntityGraph extends Graph { * statically defined */ Subgraph addTreatedSubgraph(Class type); - - /** - * Add additional attributes to this entity graph that - * correspond to attributes of subclasses of the entity type of - * this {@code EntityGraph}. Subclass subgraphs automatically - * include the specified attributes of superclass subgraphs. - * - * @param type entity subclass - * @return subgraph for the subclass - * @throws IllegalArgumentException if the type is not an entity type - * @throws IllegalStateException if the EntityGraph has been - * statically defined - * @deprecated use {@link #addTreatedSubgraph(Class)} - */ - @Deprecated(since = "3.2", forRemoval = true) - Subgraph addSubclassSubgraph(Class type); - + } diff --git a/api/src/main/java/jakarta/persistence/Graph.java b/api/src/main/java/jakarta/persistence/Graph.java index 24f6dc36..a165a461 100644 --- a/api/src/main/java/jakarta/persistence/Graph.java +++ b/api/src/main/java/jakarta/persistence/Graph.java @@ -210,25 +210,6 @@ public interface Graph { */ Subgraph addTreatedSubgraph(Attribute attribute, Class type); - /** - * Add a node to the graph that corresponds to a managed type - * with inheritance. This allows for multiple subclass - * subgraphs to be defined for this node of the entity graph. - * Subclass subgraphs will automatically include the specified - * attributes of superclass subgraphs - * - * @param attribute attribute - * @param type entity subclass - * @return subgraph for the attribute - * @throws IllegalArgumentException if the attribute's target - * type is not a managed type - * @throws IllegalStateException if this EntityGraph has been - * statically defined - * @deprecated use {@link #addTreatedSubgraph(Attribute, Class)} - */ - @Deprecated(since = "3.2", forRemoval = true) - Subgraph addSubgraph(Attribute attribute, Class type); - /** * Add a node to the graph that corresponds to a managed type. * This allows for construction of multi-node entity graphs @@ -360,41 +341,6 @@ public interface Graph { */ Subgraph addTreatedMapKeySubgraph(MapAttribute attribute, Class type); - /** - * Add a node to the graph that corresponds to a map key - * that is a managed type. This allows for construction of - * multi-node entity graphs that include related managed types. - * - * @param attribute attribute - * @return subgraph for the key attribute - * @throws IllegalArgumentException if the attribute's target - * type is not a managed type entity - * @throws IllegalStateException if this EntityGraph has been - * statically defined - * @deprecated use {@link #addMapKeySubgraph(MapAttribute)} - */ - @Deprecated(since = "3.2", forRemoval = true) - Subgraph addKeySubgraph(Attribute attribute); - - /** - * Add a node to the graph that corresponds to a map key - * that is a managed type with inheritance. This allows for - * construction of multi-node entity graphs that include related - * managed types. Subclass subgraphs will automatically include - * the specified attributes of superclass subgraphs - * - * @param attribute attribute - * @param type entity subclass - * @return subgraph for the attribute - * @throws IllegalArgumentException if the attribute's target - * type is not a managed type entity - * @throws IllegalStateException if this EntityGraph has been - * statically defined - * @deprecated use {@link #addTreatedMapKeySubgraph(MapAttribute, Class)} - */ - @Deprecated(since = "3.2", forRemoval = true) - Subgraph addKeySubgraph(Attribute attribute, Class type); - /** * Add a node to the graph that corresponds to a map key * that is a managed type. This allows for construction of diff --git a/api/src/main/java/jakarta/persistence/Persistence.java b/api/src/main/java/jakarta/persistence/Persistence.java index 4057d302..b8056c7f 100644 --- a/api/src/main/java/jakarta/persistence/Persistence.java +++ b/api/src/main/java/jakarta/persistence/Persistence.java @@ -42,16 +42,9 @@ * * @since 1.0 */ -public class Persistence { +public final class Persistence { - /** - * Default constructor. - * @deprecated This class is not intended to be extended nor instantiated, - * it is going to be marked {@code final} when this constructor becomes hidden. - */ - @Deprecated(since = "3.2", forRemoval = true) - public Persistence() { - //kept for backward compatibility with pre-3.2 versions + private Persistence() { } /** @@ -221,23 +214,4 @@ public boolean isLoaded(Object entity) { } } - /** - * This final String is deprecated and should be removed and is only here for TCK backward compatibility - * @since 1.0 - * @deprecated - * - * TODO: Either change TCK reference to PERSISTENCE_PROVIDER field to expect - * "jakarta.persistence.spi.PersistenceProvider" or remove PERSISTENCE_PROVIDER field and also update TCK signature - * tests. - */ - @Deprecated(since = "3.2", forRemoval = true) - public static final String PERSISTENCE_PROVIDER = "jakarta.persistence.spi.PersistenceProvider"; - - /** - * This instance variable is deprecated and should be removed and is only here for TCK backward compatibility - * @since 1.0 - * @deprecated - */ - @Deprecated(since = "3.2", forRemoval = true) - protected static final Set providers = new HashSet(); } diff --git a/api/src/main/java/jakarta/persistence/spi/PersistenceUnitInfo.java b/api/src/main/java/jakarta/persistence/spi/PersistenceUnitInfo.java index f6cbb4aa..8599d31a 100644 --- a/api/src/main/java/jakarta/persistence/spi/PersistenceUnitInfo.java +++ b/api/src/main/java/jakarta/persistence/spi/PersistenceUnitInfo.java @@ -21,6 +21,8 @@ import java.util.List; import java.util.Properties; import java.net.URL; + +import jakarta.persistence.PersistenceUnitTransactionType; import jakarta.persistence.SharedCacheMode; import jakarta.persistence.ValidationMode; import jakarta.persistence.EntityManagerFactory; diff --git a/api/src/main/java/jakarta/persistence/spi/PersistenceUnitTransactionType.java b/api/src/main/java/jakarta/persistence/spi/PersistenceUnitTransactionType.java deleted file mode 100644 index 832a151e..00000000 --- a/api/src/main/java/jakarta/persistence/spi/PersistenceUnitTransactionType.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2008, 2023 Oracle and/or its affiliates. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v. 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0, - * or the Eclipse Distribution License v. 1.0 which is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * - * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause - */ - -// Contributors: -// Linda DeMichiel - 2.1 -// Linda DeMichiel - 2.0 - -package jakarta.persistence.spi; - -/** - * Specifies whether entity managers created by the - * {@link jakarta.persistence.EntityManagerFactory} - * are JTA or resource-local entity managers. - * - * @since 1.0 - * - * @deprecated replaced by - * {@link jakarta.persistence.PersistenceUnitTransactionType} - */ -@Deprecated(since = "3.2", forRemoval = true) -public enum PersistenceUnitTransactionType { - - /** JTA entity managers are created. */ - JTA, - - /** Resource-local entity managers are created. */ - RESOURCE_LOCAL -} diff --git a/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc b/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc index ff6e95d4..7fd4a436 100644 --- a/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc +++ b/spec/src/main/asciidoc/ch09-container-provider-contracts.adoc @@ -516,13 +516,13 @@ application. The `PersistenceUnitInfo` interface may be found in <<_persistenceunitinfo_>>. -The enum `jakarta.persistence.spi.PersistenceUnitTransactionType` +The enum `jakarta.persistence.PersistenceUnitTransactionType` defines whether the entity managers created by the factory will be -JTA or resource-local entity managers. This enum is deprecated. +JTA or resource-local entity managers. [source,java] ---- -include::../../../../api/src/main/java/jakarta/persistence/spi/PersistenceUnitTransactionType.java[lines=18..-1] +include::../../../../api/src/main/java/jakarta/persistence/PersistenceUnitTransactionType.java[lines=18..-1] ---- The enum `jakarta.persistence.SharedCacheMode`