You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+112Lines changed: 112 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1701,6 +1701,118 @@ SolrTemplate template;
1701
1701
List<Person> people = template.solr("age:@age AND type:@type AND _entity:@entity", params);
1702
1702
----
1703
1703
1704
+
1705
+
=== Graph (Apache Tinkerpop)
1706
+
1707
+
Currently, the Jakarta NoSQL doesn't define an API for Graph database types but Eclipse JNoSQL provides a Graph template to explore the specific behavior of this NoSQL type.
1708
+
1709
+
Eclipse JNoSQL offers a mapping implementation for Graph NoSQL types:
1710
+
1711
+
[source,xml]
1712
+
----
1713
+
<dependency>
1714
+
<groupId>org.eclipse.jnosql.mapping</groupId>
1715
+
<artifactId>jnosql-mapping-graph</artifactId>
1716
+
<version>1.1.1</version>
1717
+
</dependency>
1718
+
----
1719
+
1720
+
Despite the other three NoSQL types, Eclipse JNoSQL API does not offer a communication layer for Graph NoSQL types. Instead, it integrates with https://tinkerpop.apache.org/[Apache Tinkerpop 3.x].
Apache TinkerPop is database agnostic. Thus, you can change the database in your application with no or minimal impact on source code.
1744
+
1745
+
You can define the database settings using the https://microprofile.io/microprofile-config/[MicroProfile Config] specification, so you can add properties and overwrite it in the environment following the https://12factor.net/config[Twelve-Factor App].
1746
+
1747
+
[source,properties]
1748
+
----
1749
+
jnosql.graph.provider=<CLASS-DRIVER>
1750
+
jnosql.provider.host=<HOST>
1751
+
jnosql.provider.user=<USER>
1752
+
jnosql.provider.password=<PASSWORD>
1753
+
----
1754
+
1755
+
TIP: The ```jnosql.graph.provider``` property is necessary when you have more than one driver in the classpath. Otherwise, it will take the first one.
1756
+
1757
+
These configuration settings are the default behavior. Nevertheless, there is an option to programmatically configure these settings. Create a class that implements the ```Supplier<Graph>```, then define it using the ```@Alternative``` and ```@Priority``` annotations.
1758
+
1759
+
[source,java]
1760
+
----
1761
+
@Alternative
1762
+
@Priority(Interceptor.Priority.APPLICATION)
1763
+
public class ManagerSupplier implements Supplier<Graph> {
1764
+
1765
+
@Produces
1766
+
public Graph get() {
1767
+
Graph graph = ...; // from a provider
1768
+
return graph;
1769
+
}
1770
+
}
1771
+
----
1772
+
1773
+
You can work with several document database instances through CDI qualifier. To identify each database instance, make a `Graph` visible for CDI by putting the ```@Produces``` and the ```@Database``` annotations in the method.
Eclipse JNoSQL does not provide https://mvnrepository.com/artifact/org.apache.tinkerpop/gremlin-core[Apache Tinkerpop 3 dependency]; check if the provider does. Otherwise, do it manually.
1801
+
1802
+
[source,xml]
1803
+
----
1804
+
<dependency>
1805
+
<groupId>org.apache.tinkerpop</groupId>
1806
+
<artifactId>jnosql-gremlin-core</artifactId>
1807
+
<version>${tinkerpop.version}</version>
1808
+
</dependency>
1809
+
<dependency>
1810
+
<groupId>org.apache.tinkerpop</groupId>
1811
+
<artifactId>jnosql-gremlin-groovy</artifactId>
1812
+
<version>${tinkerpop.version}</version>
1813
+
</dependency>
1814
+
----
1815
+
1704
1816
== Getting Help
1705
1817
1706
1818
Having trouble with Eclipse JNoSQL databases? We’d love to help!
0 commit comments