This is an automated email from the ASF dual-hosted git repository. pcristof pushed a commit to branch OPENJPA-2940 in repository https://gitbox.apache.org/repos/asf/openjpa.git
commit 6ffc634129ad8aa5fd2b2bc3177ebf975f4e6ad5 Author: Paulo Cristovão de Araújo Silva Filho <pcris...@gmail.com> AuthorDate: Wed Jul 16 08:24:54 2025 -0300 [OPENJPA-2940][WIP] Changing test to use jakarta property instead of openjpa one --- .../openjpa/persistence/simple/TestEntityManagerFactory.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerFactory.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerFactory.java index 0903942f2..add6bf55a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerFactory.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerFactory.java @@ -39,20 +39,25 @@ public class TestEntityManagerFactory extends TestCase { public void testEMFCreation() { PersistenceConfiguration conf = new PersistenceConfiguration("test"); conf.managedClass(AllFieldTypes.class); -// conf.property(PersistenceConfiguration.SCHEMAGEN_DATABASE_ACTION, "drop-and-create"); - conf.property("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true,SchemaAction='drop,add')"); + conf.property(PersistenceConfiguration.SCHEMAGEN_DATABASE_ACTION, "drop-and-create"); EntityManagerFactory emf = Persistence.createEntityManagerFactory(conf); assertNotNull(emf); EntityManager em = emf.createEntityManager(); assertNotNull(em); + String countJPQL = "SELECT COUNT(DISTINCT a) FROM AllFieldTypes AS a"; + long count = em.createQuery(countJPQL, Long.class).getSingleResult(); + assertEquals(0L, count); + AllFieldTypes aft = new AllFieldTypes(); em.getTransaction().begin(); em.persist(aft); em.getTransaction().commit(); assertNotNull(aft.getUniqueId()); + count = em.createQuery(countJPQL, Long.class).getSingleResult(); + assertEquals(1l, count); em.close(); emf.close();