![]() ![]() You can change the persistence depth to any value, but you should not make it less than the value used to load the corresponding data or you run the risk of not having changes you expect to be made actually being persisted in the graph.Ī depth of 0 will persist only the properties of the specified entity to the database. Neo4j-OGM is able to detect which objects and relationships require changing, so you won’t flood Neo4j with a bunch of objects that don’t require modification. This is the recommended approach because it means you can persist all your changes in one request. This means that all affected objects in the entity model that are reachable from the root object being persisted will be modified in the graph. The default depth, -1, will persist properties of the specified entity as well as every modified entity in the object graph reachable from it. Testing goes into more detail of how to set that up.Īs mentioned previously, save(entity) is overloaded as save(entity, depth), where depth dictates the number of related entities to save starting from the given entity. Sometimes you want to be able to run your tests against an in-memory version of Neo4j-OGM. The Events mechanism allows users to register event listeners for handling persistence events related both to top-level objects being saved as well as connected objects.Įvent handling discusses all the aspects of working with events. ![]() This is covered in more detail in Filters. Filtering your domain objectsįilters provides a simple API to append criteria to your stock Session.loadX() behaviour. Neo4j-OGM provides support for default and bespoke type conversions, which allow you to configure how certain data types are mapped to nodes or relationships in Neo4j. The graph data model is explained in the chapter about in the introduction chapter. To use advanced functionality like Cypher queries, a basic understanding of the graph data model is required. The implications of this are described in the transactions section. Neo4j uses transactions to guarantee the integrity of your data and Neo4j-OGM supports this fully. Neo4j-OGM offers a session for interacting with the mapped entities and the Neo4j graph database. ![]() Managing how you connect to the database is important.Ĭonnecting to the Database has all the details on what needs to happen to get you up and running. ![]() Relationships between entities are first class citizens in a graph database and therefore worth a section of it’s own describing their usage in Neo4j-OGM. You use annotations to mark domain objects to be reflected by nodes and relationships of the graph database.įor individual fields the annotations allow you to declare how they should be processed and mapped to the graph.įor property fields and references to other entities this is straightforward.īecause Neo4j is a schema-free database, Neo4j-OGM uses a simple mechanism to map Java types to Neo4j nodes using labels. To get started with your Neo4j-OGM application, you need only your domain model and the annotations provided by the library. Getting Started is the perfect place to well… get started! Configurationĭrivers, logging, properties, configuration via Java.Ĭonfiguration has got you covered. Getting started can sometimes be a chore. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |