Skip to content

Commit 7aea52b

Browse files
committed
docs: update readme file
Signed-off-by: Otavio Santana <[email protected]>
1 parent a0ddf16 commit 7aea52b

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.adoc

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,80 @@ SolrTemplate template;
18301830
List<Person> people = template.solr("age:@age AND type:@type AND _entity:@entity", params);
18311831
----
18321832

1833+
== Neo4J
1834+
1835+
image::https://jnosql.github.io/img/logos/neo4j.png[Neo4J Project,align="center",width=25%,height=25%]
1836+
https://neo4j.com/[Neo4J] is a highly scalable, native graph database designed to manage complex relationships in data. It enables developers to build applications that leverage the power of graph traversal, pattern matching, and high-performance querying using the **Cypher** query language.
1837+
1838+
This API provides support for **Graph** database operations, including entity persistence, query execution via Cypher, and relationship traversal.
1839+
1840+
=== How To Install
1841+
1842+
You can use either the Maven or Gradle dependencies:
1843+
1844+
[source,xml]
1845+
----
1846+
<dependency>
1847+
<groupId>org.eclipse.jnosql.databases</groupId>
1848+
<artifactId>jnosql-neo4j</artifactId>
1849+
<version>1.1.4</version>
1850+
</dependency>
1851+
----
1852+
1853+
=== Configuration
1854+
1855+
This API provides the `Neo4JDatabaseConfigurations` class to programmatically establish the credentials. You can configure Neo4J properties using the https://microprofile.io/microprofile-config/[MicroProfile Config] specification.
1856+
1857+
[cols="2,4"]
1858+
|===
1859+
| Configuration Property | Description
1860+
1861+
| `jnosql.neo4j.uri` | The connection URI for the Neo4J database. Example: `bolt://localhost:7687`
1862+
| `jnosql.neo4j.username` | The username for authentication.
1863+
| `jnosql.neo4j.password` | The password for authentication.
1864+
| `jnosql.neo4j.database` | The target database name.
1865+
|===
1866+
1867+
==== Example Using MicroProfile Config
1868+
1869+
[source,properties]
1870+
----
1871+
jnosql.neo4j.uri=bolt://localhost:7687
1872+
jnosql.neo4j.username=neo4j
1873+
jnosql.neo4j.password=yourpassword
1874+
jnosql.neo4j.database=neo4j
1875+
----
1876+
1877+
=== Template API
1878+
1879+
The `Neo4JTemplate` interface extends `GraphTemplate` and allows for dynamic Cypher execution.
1880+
1881+
[source,java]
1882+
----
1883+
@Inject
1884+
private Neo4JTemplate template;
1885+
1886+
List<Person> people = template.cypherQuery("MATCH (p:Person) WHERE p.name = $name RETURN p", params);
1887+
var edge = template.edge(otavio, "FRIENDS_WITH", ada);
1888+
----
1889+
1890+
=== Repository Support
1891+
1892+
The `Neo4JRepository` interface extends the `NoSQLRepository` interface and enables query execution using the `@Cypher` annotation.
1893+
1894+
[source,java]
1895+
----
1896+
@Repository
1897+
interface PersonRepository extends Neo4JRepository<Person, String> {
1898+
1899+
@Cypher("MATCH (p:Person) RETURN p")
1900+
List<Person> findAll();
1901+
1902+
@Cypher("MATCH (p:Person) WHERE p.name = $name RETURN p")
1903+
List<Person> findByName(@Param("name") String name);
1904+
}
1905+
----
1906+
18331907

18341908
== Graph (Apache Tinkerpop)
18351909

0 commit comments

Comments
 (0)