{"id":13529196,"url":"https://github.com/neo4j/neo4j-ogm","last_synced_at":"2025-04-13T02:00:20.703Z","repository":{"id":20936361,"uuid":"24224646","full_name":"neo4j/neo4j-ogm","owner":"neo4j","description":"Java Object-Graph Mapping Library for Neo4j","archived":false,"fork":false,"pushed_at":"2025-04-08T07:13:52.000Z","size":20767,"stargazers_count":344,"open_issues_count":0,"forks_count":166,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-04-13T02:00:04.303Z","etag":null,"topics":["database","graph-databases","java","neo4j","neo4j-ogm","nosql-databases","ogm"],"latest_commit_sha":null,"homepage":"https://neo4j.com/docs/ogm-manual/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGES.adoc","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-19T09:43:23.000Z","updated_at":"2025-04-08T07:13:56.000Z","dependencies_parsed_at":"2024-01-12T22:12:09.998Z","dependency_job_id":"1373c41c-96ce-44f3-bc01-648bd23bc4cf","html_url":"https://github.com/neo4j/neo4j-ogm","commit_stats":{"total_commits":1872,"total_committers":46,"mean_commits":40.69565217391305,"dds":0.7601495726495726,"last_synced_commit":"2ddbed496eee4966bd4d48ca3a84f4b6b3fb7924"},"previous_names":[],"tags_count":134,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-ogm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-ogm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-ogm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j%2Fneo4j-ogm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j","download_url":"https://codeload.github.com/neo4j/neo4j-ogm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654045,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","graph-databases","java","neo4j","neo4j-ogm","nosql-databases","ogm"],"created_at":"2024-08-01T07:00:34.246Z","updated_at":"2025-04-13T02:00:20.685Z","avatar_url":"https://github.com/neo4j.png","language":"Java","funding_links":[],"categories":["Connectors","REST API","数据库开发"],"sub_categories":["REST API","Java","语音合成"],"readme":":version: 4.0.17\n\nimage:https://github.com/neo4j/neo4j-ogm/actions/workflows/maven.yml/badge.svg[https://github.com/neo4j/neo4j-ogm/actions/workflows/maven.yml]\nimage:https://img.shields.io/maven-central/v/org.neo4j/neo4j-ogm.svg[Maven Central,link=http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.neo4j%22%20AND%20a%3A%22neo4j-ogm%22]\nimage:https://rawgit.com/aleen42/badges/master/src/stackoverflow.svg[stackoverflow,link=https://stackoverflow.com/questions/tagged/neo4j-ogm]\n\n= Neo4j-OGM - An Object Graph Mapping Library for Neo4j.\n\nNeo4j-OGM is a fast object-graph mapping library for https://neo4j.com/[Neo4j], optimised for server-based installations utilising https://neo4j.com/developer/cypher-query-language/[Cypher].\n\nIt aims to simplify development with the Neo4j graph database and like JPA, it uses annotations on simple POJO domain objects.\n\nPlease have a look at the current supported versions and which combinations we recommend:\nhttps://github.com/neo4j/neo4j-ogm/wiki/Versions[Recommended versions]\n\n== Quick start\n\n=== Dependencies for Neo4j-OGM\n\n==== Maven\n\n[source,xml,subs=\"verbatim,attributes\"]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.neo4j\u003c/groupId\u003e\n    \u003cartifactId\u003eneo4j-ogm-core\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e \u003c!-- If you're using the Bolt driver --\u003e\n    \u003cgroupId\u003eorg.neo4j\u003c/groupId\u003e\n    \u003cartifactId\u003eneo4j-ogm-bolt-driver\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n==== Gradle\n\n[source,xml,subs=\"verbatim,attributes\"]\n----\ndependencies {\n    compile 'org.neo4j:neo4j-ogm-core:{version}'\n    compile 'org.neo4j:neo4j-ogm-bolt-driver:{version}'\n}\n----\n\n\n=== Set up domain entities\n\n[source,java]\n----\n\n@NodeEntity\npublic class Actor {\n\n\t@Id @GeneratedValue\n\tprivate Long id;\n\tprivate String name;\n\n\t@Relationship(type = \"ACTS_IN\", direction = Relationship.OUTGOING)\n\tprivate Set\u003cMovie\u003e movies = new HashSet\u003c\u003e();\n\n\tpublic Actor() {\n\t}\n\n\tpublic Actor(String name) {\n\t\tthis.name = name;\n\t}\n\n\tpublic void actsIn(Movie movie) {\n\t\tmovies.add(movie);\n\t\tmovie.getActors().add(this);\n\t}\n}\n\n@NodeEntity\npublic class Movie {\n\n\t@Id @GeneratedValue\n\tprivate Long id;\n\tprivate String title;\n\tprivate int released;\n\n\tpublic Movie() {\n\t}\n\n\tpublic Movie(String title, int year) {\n\t\tthis.title = title;\n\t\tthis.released = year;\n\t}\n\n}\n\n----\n\n=== Configuration\n\nThe either configure Neo4j-OGM with properties files, or programmatically.\n\nPlease see examples http://neo4j.com/docs/ogm-manual/current/reference/#reference:configuration[here].\n\n=== Persist/Load entities\n\n[source,java]\n----\n\n//Set up the Session\nSessionFactory sessionFactory = new SessionFactory(configuration, \"movies.domain\");\nSession session = sessionFactory.openSession();\n\nMovie movie = new Movie(\"The Matrix\", 1999);\n\nActor keanu = new Actor(\"Keanu Reeves\");\nkeanu.actsIn(movie);\n\nActor carrie = new Actor(\"Carrie-Ann Moss\");\ncarrie.actsIn(movie);\n\n//Persist the movie. This persists the actors as well.\nsession.save(movie);\n\n//Load a movie\nMovie matrix = session.load(Movie.class, movie.getId());\nfor(Actor actor : matrix.getActors()) {\n    System.out.println(\"Actor: \" + actor.getName());\n}\n----\n\n== Integrations within other frameworks\n\nWe do offer two offical integrations:\n\n* The https://github.com/neo4j/neo4j-ogm-quarkus[Neo4j-OGM Quarkus Extension], which works nicely with Quarkus' \"do everything and then some\" at buildtime-approach\n* The https://github.com/neo4j/neo4j-ogm-spring[Neo4j-OGM Spring Data fork], which provides continued support for Spring Data Neo4j 5, but for modern Spring versions\n\n== Getting Help\n\nThe http://neo4j.com/docs/ogm-manual/current/[reference guide] is the best place to get started.\n\nYou can also post questions in our https://community.neo4j.com/c/drivers-stacks/spring-data-neo4j-ogm[community forums] or on http://stackoverflow.com/questions/tagged/neo4j-ogm[StackOverflow].\n\n== Building locally\n\nTo use the latest development version, just clone this repository and run `mvn clean install`.\n\nThe tests default to Bolt.\nIf you want to change this, you have to define the property `ogm.properties` when calling Maven.\ne.g. `./mvnw clean verify -Dogm.properties=ogm-bolt.properties`.\n\nFor testing we are using https://www.testcontainers.org/[TestContainers].\nThe default image right now is `neo4j:5`.\nIf you want to use other images or the enterprise edition, you have to opt-in.\n\nHere is a list of the possible environment variables you can provide.\n\n[options=\"header\"]\n|===\n|Variable |Description |Default value\n|`NEO4J_OGM_NEO4J_ACCEPT_AND_USE_COMMERCIAL_EDITION`\n|Use enterprise edition and accept the Neo4j licence agreement.\n|`no`\n|`NEO4J_OGM_NEO4J_IMAGE_NAME`\n|Image to be used by TestContainers.\n|`neo4j:5`\n|===\n\n== License\n\nNeo4j-OGM and it's modules are licensed under the Apache License v 2.0.\n\nThe only exception is the neo4j-embedded-driver which is GPL v3 due to the direct use of the Neo4j Java API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j%2Fneo4j-ogm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j%2Fneo4j-ogm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j%2Fneo4j-ogm/lists"}