[Neo] Fwd: r4160 - in laboratory/components/neo-persistence/trunk/src: main/java/org/neo4j/persistence/impl test/java/org/neo4j/persistence/impl/examples

Peter Neubauer neubauer.peter at gmail.com
Thu Apr 8 07:44:59 CEST 2010


Hi there,
seems the Neo4j JPA adapter is coming along. Would be great to get
some update, blog or docs on the state of things?

Cheers,

/peter neubauer

COO and Sales, Neo Technology

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://nosqleu.org                    - The biggest NOSQL event. Ever.
http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party.




---------- Forwarded message ----------
From:  <avishorp at lists.neo4j.org>
Date: Wed, Apr 7, 2010 at 10:11 PM
Subject: r4160 - in laboratory/components/neo-persistence/trunk/src:
main/java/org/neo4j/persistence/impl
test/java/org/neo4j/persistence/impl/examples
To: commits at neopersistence.com


Author: avishorp
Date: 2010-04-07 22:11:06 +0200 (Wed, 07 Apr 2010)
New Revision: 4160

Modified:
  laboratory/components/neo-persistence/trunk/src/main/java/org/neo4j/persistence/impl/AnnotationPersistenceSpecFactory.java
  laboratory/components/neo-persistence/trunk/src/test/java/org/neo4j/persistence/impl/examples/NC1.java
Log:
Added support for the @PropertyBag annotation

Modified: laboratory/components/neo-persistence/trunk/src/main/java/org/neo4j/persistence/impl/AnnotationPersistenceSpecFactory.java
===================================================================
--- laboratory/components/neo-persistence/trunk/src/main/java/org/neo4j/persistence/impl/AnnotationPersistenceSpecFactory.java
 2010-04-07 14:36:31 UTC (rev 4159)
+++ laboratory/components/neo-persistence/trunk/src/main/java/org/neo4j/persistence/impl/AnnotationPersistenceSpecFactory.java
 2010-04-07 20:11:06 UTC (rev 4160)
@@ -143,6 +143,7 @@
               targetSpec.bindMethod(meth, i, f);
       }

+       @SuppressWarnings("unused")
       private void handlePropertyBag(Annotation ann, Method meth)
       {
               PropertyBagDao dao = new PropertyBagDao();

Modified: laboratory/components/neo-persistence/trunk/src/test/java/org/neo4j/persistence/impl/examples/NC1.java
===================================================================
--- laboratory/components/neo-persistence/trunk/src/test/java/org/neo4j/persistence/impl/examples/NC1.java
     2010-04-07 14:36:31 UTC (rev 4159)
+++ laboratory/components/neo-persistence/trunk/src/test/java/org/neo4j/persistence/impl/examples/NC1.java
     2010-04-07 20:11:06 UTC (rev 4160)
@@ -4,7 +4,10 @@
 import org.neo4j.api.core.Traverser.Order;
 import org.neo4j.persistence.*;
 import junit.framework.TestCase;
+
+import java.util.Date;
 import java.util.Map;
+import java.util.Arrays;

 /**
 * Test Class (Node, Correct) - A relationship with Id only
@@ -40,18 +43,17 @@
               props.put("k2", 1453);
               props.put("k3", new byte[] { 10, 20, 30});
               TestCase.assertEquals("abc", props.get("k1"));
-               TestCase.assertEquals(1453, "k2");
-               TestCase.assertEquals("k3", new byte[] {10, 20, 30});
+               TestCase.assertEquals(1453, props.get("k2"));
+               TestCase.assertTrue(Arrays.equals(new byte[] {10, 20,
30}, (byte[])props.get("k3")));
               TestCase.assertEquals("abc", tnode.getProperty("k1"));
               TestCase.assertEquals(1453, tnode.getProperty("k2"));
-               byte[] b = (byte[])tnode.getProperty("k3");
-               TestCase.assertEquals(10, b[0]);
-               TestCase.assertEquals(20, b[1]);
-               TestCase.assertEquals(30, b[2]);
+               TestCase.assertTrue(Arrays.equals(new byte[] {10, 20,
30}, (byte[])tnode.getProperty("k3")));
+               try {
+                       props.put("k4", new Date(100));
+                       TestCase.fail();
+               }
+               catch(IllegalArgumentException e) {}

-
-
-
               return true;
       }


More information about the User mailing list