You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pc...@apache.org on 2025/06/22 20:39:11 UTC
(openjpa) branch OPENJPA-2937 created (now bcf65f845)
This is an automated email from the ASF dual-hosted git repository.
pcristof pushed a change to branch OPENJPA-2937
in repository https://gitbox.apache.org/repos/asf/openjpa.git
at bcf65f845 [OPENJPA-2937] Fixing field attachment and storage when using UUID
This branch includes the following new commits:
new 2806882e9 [OPENJPA-2937] Preparing for next development cycle
new bcf65f845 [OPENJPA-2937] Fixing field attachment and storage when using UUID
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(openjpa) 01/02: [OPENJPA-2937] Preparing for next development cycle
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcristof pushed a commit to branch OPENJPA-2937
in repository https://gitbox.apache.org/repos/asf/openjpa.git
commit 2806882e91a8f5c10b9614a1eb638f50e8291dd5
Author: Paulo Cristovão de Araújo Silva Filho <pc...@gmail.com>
AuthorDate: Sun Jun 22 16:47:28 2025 -0300
[OPENJPA-2937] Preparing for next development cycle
* Updated version number to 4.1.2-SNAPSHOT on pom's and manual.xml
---
openjpa-all/pom.xml | 2 +-
openjpa-examples/image-gallery/pom.xml | 2 +-
openjpa-examples/openbooks/pom.xml | 2 +-
openjpa-examples/pom.xml | 2 +-
openjpa-examples/simple/pom.xml | 2 +-
openjpa-features/pom.xml | 2 +-
openjpa-integration/daytrader/pom.xml | 2 +-
openjpa-integration/examples/pom.xml | 2 +-
openjpa-integration/jmx/pom.xml | 2 +-
openjpa-integration/pom.xml | 2 +-
openjpa-integration/slf4j/pom.xml | 2 +-
openjpa-integration/tck/pom.xml | 2 +-
openjpa-integration/validation/pom.xml | 2 +-
openjpa-jdbc/pom.xml | 2 +-
openjpa-jest/pom.xml | 2 +-
openjpa-junit5/pom.xml | 2 +-
openjpa-kernel/pom.xml | 2 +-
openjpa-kubernetes/pom.xml | 2 +-
openjpa-lib/pom.xml | 2 +-
openjpa-persistence-jdbc/pom.xml | 2 +-
openjpa-persistence-locking/pom.xml | 2 +-
openjpa-persistence/pom.xml | 2 +-
openjpa-project/pom.xml | 2 +-
openjpa-project/src/doc/manual/manual.xml | 4 ++--
openjpa-slice/pom.xml | 2 +-
openjpa-tools/openjpa-fetch-statistics-was/pom.xml | 2 +-
openjpa-tools/openjpa-fetch-statistics/pom.xml | 2 +-
openjpa-tools/openjpa-maven-plugin/pom.xml | 2 +-
openjpa-tools/pom.xml | 2 +-
openjpa-xmlstore/pom.xml | 2 +-
openjpa/pom.xml | 2 +-
pom.xml | 2 +-
32 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/openjpa-all/pom.xml b/openjpa-all/pom.xml
index 4192de2ea..3237894ca 100644
--- a/openjpa-all/pom.xml
+++ b/openjpa-all/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-all</artifactId>
diff --git a/openjpa-examples/image-gallery/pom.xml b/openjpa-examples/image-gallery/pom.xml
index ae54d2257..55cd2a55a 100644
--- a/openjpa-examples/image-gallery/pom.xml
+++ b/openjpa-examples/image-gallery/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-examples</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<groupId>org.apache.openjpa.openjpa-examples</groupId>
diff --git a/openjpa-examples/openbooks/pom.xml b/openjpa-examples/openbooks/pom.xml
index 87950916a..359d96bd7 100644
--- a/openjpa-examples/openbooks/pom.xml
+++ b/openjpa-examples/openbooks/pom.xml
@@ -29,7 +29,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-examples</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<groupId>org.apache.openjpa.openjpa-examples</groupId>
diff --git a/openjpa-examples/pom.xml b/openjpa-examples/pom.xml
index 2bf543116..71ed1e502 100644
--- a/openjpa-examples/pom.xml
+++ b/openjpa-examples/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-examples</artifactId>
diff --git a/openjpa-examples/simple/pom.xml b/openjpa-examples/simple/pom.xml
index 51247e3bc..045423e5f 100644
--- a/openjpa-examples/simple/pom.xml
+++ b/openjpa-examples/simple/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-examples</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<groupId>org.apache.openjpa.openjpa-examples</groupId>
diff --git a/openjpa-features/pom.xml b/openjpa-features/pom.xml
index 4c4e77f1b..2c311c101 100644
--- a/openjpa-features/pom.xml
+++ b/openjpa-features/pom.xml
@@ -18,7 +18,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-features</artifactId>
diff --git a/openjpa-integration/daytrader/pom.xml b/openjpa-integration/daytrader/pom.xml
index cb33e6f4a..746f33942 100644
--- a/openjpa-integration/daytrader/pom.xml
+++ b/openjpa-integration/daytrader/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-daytrader</artifactId>
diff --git a/openjpa-integration/examples/pom.xml b/openjpa-integration/examples/pom.xml
index f09634e76..d32cb3704 100644
--- a/openjpa-integration/examples/pom.xml
+++ b/openjpa-integration/examples/pom.xml
@@ -37,7 +37,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-examples</artifactId>
diff --git a/openjpa-integration/jmx/pom.xml b/openjpa-integration/jmx/pom.xml
index 0f3e379d6..7dc4b1c9f 100644
--- a/openjpa-integration/jmx/pom.xml
+++ b/openjpa-integration/jmx/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-jmx</artifactId>
diff --git a/openjpa-integration/pom.xml b/openjpa-integration/pom.xml
index 2a80e6ca6..1d553c32a 100644
--- a/openjpa-integration/pom.xml
+++ b/openjpa-integration/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration</artifactId>
diff --git a/openjpa-integration/slf4j/pom.xml b/openjpa-integration/slf4j/pom.xml
index 8753fa4db..3edcc69c4 100644
--- a/openjpa-integration/slf4j/pom.xml
+++ b/openjpa-integration/slf4j/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-slf4j</artifactId>
diff --git a/openjpa-integration/tck/pom.xml b/openjpa-integration/tck/pom.xml
index 01615fbe9..1921fac9e 100644
--- a/openjpa-integration/tck/pom.xml
+++ b/openjpa-integration/tck/pom.xml
@@ -78,7 +78,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-tck</artifactId>
diff --git a/openjpa-integration/validation/pom.xml b/openjpa-integration/validation/pom.xml
index 6ae1ad5c1..7a57cae94 100644
--- a/openjpa-integration/validation/pom.xml
+++ b/openjpa-integration/validation/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-integration</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-integration-validation</artifactId>
diff --git a/openjpa-jdbc/pom.xml b/openjpa-jdbc/pom.xml
index 3ebbfe765..4d15b8ddf 100644
--- a/openjpa-jdbc/pom.xml
+++ b/openjpa-jdbc/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-jdbc</artifactId>
diff --git a/openjpa-jest/pom.xml b/openjpa-jest/pom.xml
index 9dc147117..a09ed8fc8 100644
--- a/openjpa-jest/pom.xml
+++ b/openjpa-jest/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-jest</artifactId>
diff --git a/openjpa-junit5/pom.xml b/openjpa-junit5/pom.xml
index e865ac5ac..4362608a7 100644
--- a/openjpa-junit5/pom.xml
+++ b/openjpa-junit5/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-junit5</artifactId>
diff --git a/openjpa-kernel/pom.xml b/openjpa-kernel/pom.xml
index 09ac39dde..31fec2de8 100644
--- a/openjpa-kernel/pom.xml
+++ b/openjpa-kernel/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-kernel</artifactId>
diff --git a/openjpa-kubernetes/pom.xml b/openjpa-kubernetes/pom.xml
index 746ecc38c..d1e8c8284 100644
--- a/openjpa-kubernetes/pom.xml
+++ b/openjpa-kubernetes/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-kubernetes</artifactId>
diff --git a/openjpa-lib/pom.xml b/openjpa-lib/pom.xml
index d6e3c2f62..0f4a934fc 100644
--- a/openjpa-lib/pom.xml
+++ b/openjpa-lib/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-lib</artifactId>
diff --git a/openjpa-persistence-jdbc/pom.xml b/openjpa-persistence-jdbc/pom.xml
index 1b03a4ebe..a9461d19c 100644
--- a/openjpa-persistence-jdbc/pom.xml
+++ b/openjpa-persistence-jdbc/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-persistence-jdbc</artifactId>
diff --git a/openjpa-persistence-locking/pom.xml b/openjpa-persistence-locking/pom.xml
index 63891c5fe..dbd4672bd 100644
--- a/openjpa-persistence-locking/pom.xml
+++ b/openjpa-persistence-locking/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-persistence-locking</artifactId>
diff --git a/openjpa-persistence/pom.xml b/openjpa-persistence/pom.xml
index 23933454c..148173990 100644
--- a/openjpa-persistence/pom.xml
+++ b/openjpa-persistence/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-persistence</artifactId>
diff --git a/openjpa-project/pom.xml b/openjpa-project/pom.xml
index fe3560948..5bee07d4c 100644
--- a/openjpa-project/pom.xml
+++ b/openjpa-project/pom.xml
@@ -39,7 +39,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>apache-openjpa</artifactId>
diff --git a/openjpa-project/src/doc/manual/manual.xml b/openjpa-project/src/doc/manual/manual.xml
index e462634f6..ab17a4c76 100644
--- a/openjpa-project/src/doc/manual/manual.xml
+++ b/openjpa-project/src/doc/manual/manual.xml
@@ -62,9 +62,9 @@
]>
<book id="manual">
<bookinfo>
- <title>Apache OpenJPA 3.2 User's Guide</title>
+ <title>Apache OpenJPA 4.1.2-SNAPSHOT User's Guide</title>
<copyright>
- <year>2006-2021</year>
+ <year>2006-2025</year>
<holder>The Apache Software Foundation</holder>
</copyright>
<releaseinfo>Built from OpenJPA version <?eval ${openjpa.version}?> revision <?eval ${buildNumber}?>.</releaseinfo>
diff --git a/openjpa-slice/pom.xml b/openjpa-slice/pom.xml
index b05732d1a..3353132e2 100644
--- a/openjpa-slice/pom.xml
+++ b/openjpa-slice/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-slice</artifactId>
diff --git a/openjpa-tools/openjpa-fetch-statistics-was/pom.xml b/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
index 73556dbf8..f5e8e1654 100644
--- a/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
+++ b/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-tools</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-fetch-statistics-was</artifactId>
diff --git a/openjpa-tools/openjpa-fetch-statistics/pom.xml b/openjpa-tools/openjpa-fetch-statistics/pom.xml
index 31cbf4618..58f0d4d27 100644
--- a/openjpa-tools/openjpa-fetch-statistics/pom.xml
+++ b/openjpa-tools/openjpa-fetch-statistics/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-tools</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-fetch-statistics</artifactId>
diff --git a/openjpa-tools/openjpa-maven-plugin/pom.xml b/openjpa-tools/openjpa-maven-plugin/pom.xml
index 52a8e08dd..cf806acf1 100644
--- a/openjpa-tools/openjpa-maven-plugin/pom.xml
+++ b/openjpa-tools/openjpa-maven-plugin/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-tools</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/openjpa-tools/pom.xml b/openjpa-tools/pom.xml
index 7598370a2..744b64fab 100644
--- a/openjpa-tools/pom.xml
+++ b/openjpa-tools/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
<!-- <relativePath>../pom.xml</relativePath>-->
</parent>
diff --git a/openjpa-xmlstore/pom.xml b/openjpa-xmlstore/pom.xml
index a4b39a91c..22d956d78 100644
--- a/openjpa-xmlstore/pom.xml
+++ b/openjpa-xmlstore/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa-xmlstore</artifactId>
diff --git a/openjpa/pom.xml b/openjpa/pom.xml
index b5aa2b34d..6f836cddc 100644
--- a/openjpa/pom.xml
+++ b/openjpa/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
</parent>
<artifactId>openjpa</artifactId>
diff --git a/pom.xml b/pom.xml
index ac5af5327..2652dd416 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
<name>OpenJPA Parent POM</name>
<description>Apache OpenJPA implementation of Jakarta JPA 3.1</description>
- <version>4.1.1-SNAPSHOT</version>
+ <version>4.1.2-SNAPSHOT</version>
<properties>
<java.class.version>11</java.class.version>
(openjpa) 02/02: [OPENJPA-2937] Fixing field attachment and storage when using UUID
Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
pcristof pushed a commit to branch OPENJPA-2937
in repository https://gitbox.apache.org/repos/asf/openjpa.git
commit bcf65f84519784b334dcd13e850bcd34d483cc49
Author: Paulo Cristovão de Araújo Silva Filho <pc...@gmail.com>
AuthorDate: Sun Jun 22 17:37:26 2025 -0300
[OPENJPA-2937] Fixing field attachment and storage when using UUID
* Fixed merging auto-generated UUID valued entity when it was not previously persisted
* Fixed storage of query when using UUID fields
---
.../apache/openjpa/jdbc/kernel/JDBCStoreQuery.java | 1 +
.../org/apache/openjpa/kernel/AttachStrategy.java | 1 +
.../generationtype/TestUuidGeneratedEntity.java | 63 ++++++++++++++++++++++
.../generationtype/UuidGeneratedEntity.java | 13 +++++
4 files changed, 78 insertions(+)
diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java
index ebd107f2d..e032bcbbd 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java
@@ -1048,6 +1048,7 @@ public class JDBCStoreQuery
case JavaTypes.BIGINTEGER:
case JavaTypes.LOCALE:
case JavaTypes.OBJECT:
+ case JavaTypes.UUID_OBJ:
case JavaTypes.OID:
return sm.fetchObjectField(i);
default:
diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachStrategy.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachStrategy.java
index 6b3e657e7..7a9ee8f30 100644
--- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachStrategy.java
+++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AttachStrategy.java
@@ -201,6 +201,7 @@ abstract class AttachStrategy
case JavaTypes.OBJECT:
case JavaTypes.OID:
case JavaTypes.ENUM:
+ case JavaTypes.UUID_OBJ:
val = fetchObjectField(i);
if (val == null && !nullLoaded)
return false;
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestUuidGeneratedEntity.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestUuidGeneratedEntity.java
index 9796bea0d..be205c17a 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestUuidGeneratedEntity.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestUuidGeneratedEntity.java
@@ -74,6 +74,69 @@ public class TestUuidGeneratedEntity extends SingleEMFTestCase {
closeEM(em);
}
+ public void testMergeBeforePersist() {
+ EntityManager em = emf.createEntityManager();
+
+ UuidGeneratedEntity gv1 = new UuidGeneratedEntity();
+
+ em.getTransaction().begin();
+ gv1 = em.merge(gv1);
+ em.getTransaction().commit();
+
+ em.refresh(gv1);
+
+ assertNotNull(gv1.getId());
+ assertNotNull(gv1.getNativeUuid());
+ closeEM(em);
+ }
+
+ public void testDetachAndMerge() {
+ EntityManager em = emf.createEntityManager();
+ UuidGeneratedEntity gv = new UuidGeneratedEntity();
+ gv.setBasicUuid(UUID.randomUUID());
+
+ em.getTransaction().begin();
+ em.persist(gv);
+ em.getTransaction().commit();
+
+ assertTrue(em.contains(gv));
+ em.detach(gv);
+ em.clear();
+ assertFalse(em.contains(gv));
+
+ Long v = gv.getVersion();
+ gv.setBasicUuid(UUID.randomUUID());
+
+ em.getTransaction().begin();
+ gv = em.merge(gv);
+ em.getTransaction().commit();
+
+ assertTrue((v + 1) == gv.getVersion());
+
+ closeEM(em);
+ }
+
+ public void testGetByReference() {
+ EntityManager em = emf.createEntityManager();
+ UuidGeneratedEntity gv = new UuidGeneratedEntity();
+
+ em.getTransaction().begin();
+ em.persist(gv);
+ em.getTransaction().commit();
+
+ assertTrue(em.contains(gv));
+ em.detach(gv);
+ UUID id = gv.getId();
+ UUID nid = gv.getNativeUuid();
+
+ em.getTransaction().begin();
+ UuidGeneratedEntity rgv = em.getReference(UuidGeneratedEntity.class, id);
+ assertEquals(nid, rgv.getNativeUuid());
+ em.getTransaction().commit();
+
+ closeEM(em);
+ }
+
public void testFindByUUIDProperty() {
EntityManager em = emf.createEntityManager();
diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/UuidGeneratedEntity.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/UuidGeneratedEntity.java
index 6c1909932..b8907bc96 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/UuidGeneratedEntity.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/UuidGeneratedEntity.java
@@ -27,6 +27,7 @@ import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Version;
@Entity
public class UuidGeneratedEntity {
@@ -46,6 +47,10 @@ public class UuidGeneratedEntity {
private UUID basicUuid;
+ @Version
+ @Column(name = "version_")
+ private Long version;
+
@ManyToOne
private UuidGeneratedEntity parent;
@@ -93,4 +98,12 @@ public class UuidGeneratedEntity {
this.parent = parent;
}
+ public Long getVersion() {
+ return version;
+ }
+
+ public void setVersion(Long version) {
+ this.version = version;
+ }
+
}