Skip to content

Commit

Permalink
#77: EntityManager(Factory) should implement AutoCloseable (#312)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <[email protected]>
  • Loading branch information
lukasj authored Apr 26, 2021
1 parent 7b2ed30 commit 1ae01ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/jakarta/persistence/EntityManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021 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
Expand Down Expand Up @@ -51,7 +51,7 @@
*
* @since 1.0
*/
public interface EntityManager {
public interface EntityManager extends AutoCloseable {

/**
* Make an instance managed and persistent.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021 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
Expand Down Expand Up @@ -32,7 +32,7 @@
*
* @since 1.0
*/
public interface EntityManagerFactory {
public interface EntityManagerFactory extends AutoCloseable {

/**
* Create a new application-managed <code>EntityManager</code>.
Expand Down
8 changes: 6 additions & 2 deletions spec/src/main/asciidoc/appendixes.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017, 2020 Contributors to the Eclipse Foundation
// Copyright (c) 2017, 2021 Contributors to the Eclipse Foundation
//

[appendix]
Expand Down Expand Up @@ -71,4 +71,8 @@ Packages of all API classes were changed to _jakarta.persistence_. These changes
Schema namespaces were changed from http://xmlns.jcp.org/xml/ns/persistence and http://xmlns.jcp.org/xml/ns/persistence/orm
to https://jakarta.ee/xml/ns/persistence and https://jakarta.ee/xml/ns/persistence/orm

References to schema versions lower than 2.2 were removed.
References to schema versions lower than 2.2 were removed.

=== Jakarta Persistence 3.1

EntityManagerFactory and EntityManager interfaces extend java.lang.AutoCloseable interface
4 changes: 2 additions & 2 deletions spec/src/main/asciidoc/ch03-entity-operations.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017, 2020 Contributors to the Eclipse Foundation
// Copyright (c) 2017, 2021 Contributors to the Eclipse Foundation
//

== Entity Operations [[a1060]]
Expand Down Expand Up @@ -84,7 +84,7 @@ import jakarta.persistence.criteria.CriteriaDelete;
*
* @since 1.0
*/
public interface EntityManager {
public interface EntityManager extends AutoCloseable {
/**
* Make an instance managed and persistent.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017, 2020 Contributors to the Eclipse Foundation
// Copyright (c) 2017, 2021 Contributors to the Eclipse Foundation
//

== Entity Managers and Persistence Contexts [[a11431]]
Expand Down Expand Up @@ -223,7 +223,7 @@ import jakarta.persistence.criteria.CriteriaBuilder;
*
* @since 1.0
*/
public interface EntityManagerFactory {
public interface EntityManagerFactory extends AutoCloseable {
/**
* Create a new application-managed <code>EntityManager</code>.
Expand Down

0 comments on commit 1ae01ae

Please sign in to comment.