Version 2

    You can use Neo4J's graphical console to explore the nodes created by Hibernate OGM in its unit test.

     

    Requirements

    Get Hibernate OGM's git repository.

    Download Neo4J's server distribution: http://neo4j.com/download/

    Unzip it (<NEO4J_SERVER> )

     

    Procedure

     

    Hibernate OGM currently only works in Neo4J's embedded mode, so we need a few manual steps to point the server instance to the files of the embedded instance.

     

    • In your IDE, put a break point in your unit test at the stage where you want to study the database state (note that this must be after the transaction has been committed).
    • Run the test in debug mode.
    • Stop the test when the break point is reached. This is necessary otherwise you won't be able to start the Neo4J server on the same files the embedded server writes to.
    • The database files will be stored in <ogm-dir>/neo4j/target/NEO4J/neo4j-db-<some-random-name>.
    • Edit <NEO4J_SERVER>/conf/neo4j-server.properties;
      Replace the following property with org.neo4j.server.database.location=<ogm-dir>/neo4j/target/NEO4J/neo4j-db-<some-random-name>
    • Run <NEO4J_SERVER>/bin/neo4j start

     

    You can now use the console at http://localhost:7474

     

    When you are done, call <NEO4J_SERVER>/bin/neo4j stop