From 39dc3aa7db0341457c438693af5ba9bb1cfdf560 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Wed, 12 Mar 2025 20:31:40 -0400 Subject: General update It's been a bit too long for me to recall what all I was doing here and what it should've been doing. Just looking at the files, I was attempting to figure out how the EO stuff works. Think I had some basic results, but just mostly added a tracing store to help w/ debugging --- .../src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java') diff --git a/projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java b/projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java index 90add1a..d572af0 100644 --- a/projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java +++ b/projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java @@ -9,6 +9,7 @@ import net.wotonomy.control.EOClassDescription; import net.wotonomy.control.EOEditingContext; import net.wotonomy.control.EOKeyGlobalID; import net.wotonomy.control.EOTemporaryGlobalID; +import net.wotonomy.control.EOVectorKeyGlobalID; import net.wotonomy.foundation.NSDictionary; public class JDBCDBTest extends TestCase { @@ -66,25 +67,27 @@ public class JDBCDBTest extends TestCase { EODatabase db = new EODatabase(adaptor); EODatabaseContext dbCtx = new EODatabaseContext(db); ((JDBCContext)dbCtx.adaptorContext()).connect(); + ((JDBCContext)dbCtx.adaptorContext()).beginTransaction(); EOEditingContext editCtx = new EOEditingContext(dbCtx); EOClassDescription personDesc = EOClassDescription.classDescriptionForClass(Person.class); - EOTemporaryGlobalID tempGID = new EOTemporaryGlobalID(); - Person person = personDesc.createInstanceWithEditingContext(editCtx, tempGID); - + EOKeyGlobalID personID = new EOVectorKeyGlobalID("John Doe", "John", "Doe"); + //Person person = personDesc.createInstanceWithEditingContext(editCtx, personID); + Person person = new Person(); person.setFirstName("John"); person.setLastName("Doe"); person.setAge(25); + editCtx.insertObjectWithGlobalID(person, personID); editCtx.saveChanges(); //editCtx.invalidateAllObjects(); ((JDBCContext)dbCtx.adaptorContext()).commitTransaction(); //editCtx.reset(); - Person newPerson = (Person) editCtx.objectForGlobalID(tempGID); + Person newPerson = (Person) editCtx.objectForGlobalID(personID); assertEquals(person, newPerson); } } \ No newline at end of file -- cgit v1.2.3