summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2025-03-12 20:31:40 -0400
committerBenjamin Culkin <scorpress@gmail.com>2025-03-12 20:31:40 -0400
commit39dc3aa7db0341457c438693af5ba9bb1cfdf560 (patch)
treec3514435d82c34e0443a339dec2ae1ee91cb2215 /projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java
parentbe03e4adfe97561553c9ed2c10561c49d35c06d9 (diff)
General updateworking
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
Diffstat (limited to 'projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java')
-rw-r--r--projects/net.wotonomy.persistence.adapter.jdbc/src/test/java/net/wotonomy/jdbcadaptor/JDBCDBTest.java11
1 files changed, 7 insertions, 4 deletions
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<Person> 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