Accessing and querying the database
This page describes how to access and query the graph database from java code.
The DataAccess interface
DataAccess is the entry point to the graph database. It provides access to 3 main database functions:
- The QueryFactory which enables you to perform read, write and update operations
- The MetaModel which provides information about the data graph currently stored in the database. For more information, see the MetaModel page
- Registration of listeners to obtain database change notifications.
To obtain an instance of a DataAccess. You need to use constructor injection from any class annotated with @Module or @Service or @CoreImpl as shown below:
@Module
public class MyFeature implements ModularInterface{
// Private Reference
private final DataAccess access;
// Constructor injection
public MyFeature(DataAccess access){
this.access = access;
}
}
If you wish to learn more about dependency injection, please have a look at the dependency injection page