Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Neo4j 2.1.0.M1 Released Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Neo4j 2.1.0.M1 Released

    Dear Spring-NOSQL Community,

    Since the last release of Spring Data Neo4j we worked on a number of issues that you raised as important improvements and extensions.

    Thanks to Mark Spitzler, Oliver Gierke, Rajaram Ganeshan, Laurent Pireyn for their contributions
    and all the other community members for the feedback and discussions.

    We want to encourage you to give it a try, especially the new things and give us your feedback.

    We are aware of the plenthora of issues that are still open and want to address them by the 2.1 release which is planned for the end of March -
    aligned with Neo4j 1.7.

    If you have any questions or suggestions don't hesitate to ask here on the Spring Forums, the Neo4j Google Group or by raising an issue in JIRA.

    Please also check out the Spring Data Neo4j Guidebook on InfoQ. It is available as PDF and ePUB and soon also in print.

    Enjoy!

    Changes in version 2.1.M1 (2012-03-02)

    * DATAGRAPH-181 added support for unique entities with template.getOrCreateNode and @Indexed(unique=true)
    * DATAGRAPH-198 added support for custom target type, e.g. storing a Date converted to a Long @GraphProperty(propertyType=Long.class)
    * DATAGRAPH-102 fixed type representation in graph with support for @TypeAlias to allow shorter type-identifiers in the graph
    * DATAGRAPH-204 pom.xml cleanup (repositories) and dependency to SFW is now range from 3.0.7.RELEASE - 3.2
    * DATAGRAPH-185 cypher queries for single fields return null on no results
    * DATAGRAPH-182 allow @RelatedTo on Single RelationshipEntity fields + internal refactorings
    * DATAGRAPH-202 provide a getRelationshipsBetween() method in Neo4jTemplate
    * GH-#34 Fix for using Neo4j High-Availability
    * DATAGRAPH-176 Added debug log output for cypher and gremlin query as well as derived query methods
    * DATAGRAPH-186 default value for readonly relationship collections
    * DATAGRAPH-173 fixed verify method for interfaces, added interface support for type-representation strategies
    * DATAGRAPH-169 Backquoting all variable parts of derived finder queries to accommodate for non-identifier names.
    * DATAGRAPH-164 Added methods to determine stored java type to neo4j-template and crud-repository
    * DATAGRAPH-166 fixed multiple sort parameters
    * documentation updates

  • #2
    @Indexed(unique=true) usage

    Hello!
    I noticed that the @Indexed(unique=true)feature works fine with template.save(entity);

    (meaning that if i template.save(..) 2 nodes with different properties but same property marked with the @Indexed(unique=true) annotation, it just updates the first user's properties and does not create a duplicate node...wich is exactlly what i am looking for)

    but i read in the documentation that i should use it with template.getOrCreateNode(takes 4 parameters);
    why is that? should i replate the template.save(..) with template.getOrCreateNode(takes 4 parameters)?
    if so, give me a usage example because i can't seem to figure out those 4 parameters.

    Thanks!

    Comment


    • #3
      @Indexed(unique=true) problem

      I have a problem using @Indexed(unique=true).

      I have a User class with @Indexed(unique=true) String uniqueId; and String name; and i save it.

      Then if another user has refference to the first user's uniqueId in his list of friends, when the FRIEND relationship is created, the name property of the first user vanishes. (is they have many properties, they all vanish).

      How do i fix this?

      Comment


      • #4
        Spring-Data neo4j configuration

        Hello!

        I'm trying to develop a test with spring-data neo4j and I'm trying to insert neo4j.properties to set neo4j mapped files. I'm searching some way to do this. I try to create a applicationContext.xml with this bean:


        <bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase"
        destroy-method="shutdown" scope="singleton">
        <constructor-arg value="target/db/graph.db" />
        <constructor-arg>
        <map>
        <entry key="use_memory_mapped_buffers" value="true" />
        <entry key="cache_type" value="none" />
        <entry key="neostore.nodestore.db.mapped_memory" value="10M" />
        <entry key="neostore.propertystore.db.mapped_memory" value="40M" />
        <entry key="neostore.relationshipstore.db.mapped_memory"
        value="2G" />
        <entry key="neostore.propertystore.db.index.keys.mapped_m emory"
        value="5M" />
        <entry key="neostore.propertystore.db.index.mapped_memory "
        value="5M" />
        <entry key="neostore.propertystore.db.strings.mapped_memo ry"
        value="1M" />
        <entry key="neostore.propertystore.db.arrays.mapped_memor y"
        value="0M" />
        </map>
        </constructor-arg>
        </bean>

        and also generating a graph.db file with properties inside.

        How can I do this? Thank you!

        Comment


        • #5
          uradhalat,

          SQL is for RDBMSes, for Neo4j we have Cypher: http://docs.neo4j.org/chunked/snapsh...uery-lang.html

          Start there.

          Lasse

          Comment


          • #6
            Hi Michael,

            do you have any idea when the next release based on neo4-j 1.8.x will be available?

            Currently I'm working on a productive solution based on neo4j 1.8 and I would love to use spring data in the future.

            Best regards,
            twilight

            Comment


            • #7
              twilight,

              The latest RC is compatible with Neo4j 1.8:

              http://repo.springsource.org/milesto...o4j/2.1.0.RC2/

              The release should be only a couple of weeks away now.

              Lasse

              Comment


              • #8
                Are there plans to include support for the latest version of Gremlin (v. 2.1.0)?

                When trying to run a Gremlin query using 2.1.0 it fails with a java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/pgm/Vertex because of a refactor of the Gremlin library that moved everything in com.tinkerpop.blueprints.pgm to com.tinkerpop.blueprint.

                Comment


                • #9
                  SDN 2.1.RC3 was available in early August.

                  Comment


                  • #10
                    Don't know, as Neo4j has not been updated to use Gremlin 2.x (due to the many changes and lack of uptake) we will probably stick to that version.

                    You can probably upgrade it yourself in your pom and excluding the dependencies from spring-data-neo4j.

                    Comment


                    • #11
                      Sorry, I should have stated that I was using RC3. I wanted to post this question in a thread related to that release but couldn't find one.

                      I'm not sure I'm following. I can use the latest version of Gremlin and the Gremlin console to issue queries against Neo4j v. 1.8.M07 (using some features introduced in 2.x) without problem so Neo4j seems to support it.

                      Also, what I want to do is to issue queries using Gremlin from within SDN in order to get domain objects back which I assume will be a lot more complicated if I have to do it without the query support of SDN.

                      In any case, thanks for the response. I will look into alternative ways to solve my problem now that I know that Gremlin 2.x won't be supported in the near future.

                      Comment


                      • #12
                        Maybe just a little bit more clarification about dependencies with TinkerPop Gremlin:
                        When I try to issue this Gremlin query:

                        @Query(value = "g.v(0).out('knows')", type = QueryType.Gremlin)
                        Iterable<User> findAllFriendsByName(@Param("fullName") String name);

                        I get this error message:
                        java.lang.IllegalStateException: Gremlin is not available, please add it to your dependencies to execute: g.v(0).out('knows')
                        at org.springframework.data.neo4j.support.DelegatingG raphDatabase$FailingQueryEngine.query(DelegatingGr aphDatabase.java:255)
                        at org.springframework.data.neo4j.repository.query.Gr aphRepositoryQuery.dispatchQuery(GraphRepositoryQu ery.java:91)
                        at org.springframework.data.neo4j.repository.query.Gr aphRepositoryQuery.execute(GraphRepositoryQuery.ja va:70)
                        at org.springframework.data.repository.core.support.R epositoryFactorySupport$QueryExecutorMethodInterce ptor.invoke(RepositoryFactorySupport.java:302)
                        at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
                        at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:110)
                        at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
                        at org.springframework.dao.support.PersistenceExcepti onTranslationInterceptor.invoke(PersistenceExcepti onTranslationInterceptor.java:155)
                        at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
                        at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
                        at $Proxy32.findAllFriendsByName(Unknown Source)
                        at test.Tester.shouldRetrieveAUserKnownFriends(Tester .java:75)
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
                        at java.lang.reflect.Method.invoke(Unknown Source)
                        at org.junit.runners.model.FrameworkMethod$1.runRefle ctiveCall(FrameworkMethod.java:44)
                        at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
                        at org.junit.runners.model.FrameworkMethod.invokeExpl osively(FrameworkMethod.java:41)
                        at org.junit.internal.runners.statements.InvokeMethod .evaluate(InvokeMethod.java:20)
                        at org.junit.internal.runners.statements.RunBefores.e valuate(RunBefores.java:28)
                        at org.springframework.test.context.junit4.statements .RunBeforeTestMethodCallbacks.evaluate(RunBeforeTe stMethodCallbacks.java:74)
                        at org.junit.internal.runners.statements.RunAfters.ev aluate(RunAfters.java:31)
                        at org.springframework.test.context.junit4.statements .RunAfterTestMethodCallbacks.evaluate(RunAfterTest MethodCallbacks.java:82)
                        at org.springframework.test.context.junit4.statements .SpringRepeat.evaluate(SpringRepeat.java:72)
                        at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:231)
                        at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:49)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner. java:193)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:52)
                        at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:191)
                        at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:42)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:184)
                        at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes tClassCallbacks.java:61)
                        at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC lassCallbacks.java:70)
                        at org.junit.runners.ParentRunner.run(ParentRunner.ja va:236)
                        at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:174 )
                        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
                        at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
                        at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
                        at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
                        at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
                        at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)


                        This is my (probably messed up) pom.xml:

                        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                        <modelVersion>4.0.0</modelVersion>
                        <groupId>MyProject</groupId>
                        <artifactId>MyProject</artifactId>
                        <version>0.0.1-SNAPSHOT</version>
                        <dependencies>
                        <dependency>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-neo4j</artifactId>
                        <version>2.0.1.RELEASE</version>
                        </dependency>
                        <dependency>
                        <groupId>org.neo4j</groupId>
                        <artifactId>neo4j-cypher</artifactId>
                        <version>1.6.M02</version>
                        </dependency>
                        <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-test</artifactId>
                        <version>3.0.6.RELEASE</version>
                        <scope>test</scope>
                        </dependency>
                        <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.8.2</version>
                        <scope>test</scope>
                        </dependency>
                        <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>2.0.1</version>
                        </dependency>
                        <dependency>
                        <groupId>com.tinkerpop.gremlin</groupId>
                        <artifactId>gremlin-groovy</artifactId>
                        <version>2.1.0</version>
                        </dependency>
                        <dependency>
                        <groupId>com.tinkerpop.blueprints</groupId>
                        <artifactId>blueprints</artifactId>
                        <version>2.1.0</version>
                        <type>pom</type>
                        </dependency>
                        <dependency>
                        <groupId>com.tinkerpop.blueprints</groupId>
                        <artifactId>blueprints-core</artifactId>
                        <version>2.1.0</version>
                        <type>zip</type>
                        </dependency>
                        <dependency>
                        <groupId>com.tinkerpop.blueprints</groupId>
                        <artifactId>blueprints-neo4j-graph</artifactId>
                        <version>2.1.0</version>
                        </dependency>
                        <dependency>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-neo4j-rest</artifactId>
                        <version>2.0.1.RELEASE</version>
                        </dependency>
                        </dependencies>
                        <build>
                        ...
                        </build>
                        </project>

                        Comment


                        • #13
                          Can you please post this in a separate thread.

                          Comment

                          Working...
                          X