public static class Configuration.Builder extends Object
Configuration class| Modifier and Type | Field and Description |
|---|---|
DatabaseSelectionProvider |
databaseSelectionProvider |
UserSelectionProvider |
userSelectionProvider |
| Constructor and Description |
|---|
Builder()
Creates new Configuration builder
Use for Java configuration.
|
Builder(ConfigurationSource configurationSource)
Creates new Configuration builder
|
| Modifier and Type | Method and Description |
|---|---|
Configuration.Builder |
autoIndex(String autoIndex)
Auto index config, for possible values see
AutoIndexMode |
Configuration |
build() |
Configuration.Builder |
connectionLivenessCheckTimeout(Integer connectionLivenessCheckTimeout) |
Configuration.Builder |
connectionPoolSize(Integer connectionPoolSize)
Number of connections to the database.
|
static Configuration.Builder |
copy(Configuration.Builder builder) |
Configuration.Builder |
credentials(String username,
String password)
Credentials to use to access the database
|
Configuration.Builder |
database(String database)
Configures the database to use.
|
Configuration.Builder |
databaseSelectionProvider(DatabaseSelectionProvider databaseSelectionProvider)
Configures the database to use.
|
Configuration.Builder |
encryptionLevel(String encryptionLevel)
Required encryption level for the connection to the database.
|
Configuration.Builder |
generatedIndexesOutputDir(String generatedIndexesOutputDir) |
Configuration.Builder |
generatedIndexesOutputFilename(String generatedIndexesOutputFilename) |
Configuration.Builder |
neo4jConfLocation(String neo4jConfLocation) |
Configuration.Builder |
relaxedQuerying()
Turns strict querying off and uses only the single static label of a domain class, even if this class is part
of an inheritance hierarchy exposing more than one static label.
|
Configuration.Builder |
strictQuerying()
Turns on strict querying.
|
Configuration.Builder |
trustCertFile(String trustCertFile) |
Configuration.Builder |
trustStrategy(String trustStrategy) |
Configuration.Builder |
uri(String uri)
Set URI of the database.
|
Configuration.Builder |
uris(String[] uris)
Set additional URIS to connect to causal cluster.
|
Configuration.Builder |
useNativeTypes()
Turns on the support for native types on the transport level.
|
Configuration.Builder |
userSelectionProvider(UserSelectionProvider userSelectionProvider)
Configures the user selection provider to use.
|
Configuration.Builder |
verifyConnection(Boolean verifyConnection)
Whether OGM should verify connection to the database at creation of the Driver
Useful for "fail-fast" type of configuration where the database is expected to be running during application
start up and the connection to the database is expected to be very stable.
|
Configuration.Builder |
withBasePackages(String... basePackages)
Configures the builder with a list of base packages to scan.
|
Configuration.Builder |
withCustomProperty(String name,
Object value) |
public DatabaseSelectionProvider databaseSelectionProvider
public UserSelectionProvider userSelectionProvider
public Builder()
public Builder(ConfigurationSource configurationSource)
configurationSource - source of the configuration, file on classpath or filesystempublic static Configuration.Builder copy(Configuration.Builder builder)
public Configuration.Builder uri(String uri)
uri - uri of the databasepublic Configuration.Builder uris(String[] uris)
uris - urispublic Configuration.Builder connectionPoolSize(Integer connectionPoolSize)
connectionPoolSize - number of connections to the databasepublic Configuration.Builder encryptionLevel(String encryptionLevel)
encryptionLevel - required encryption levelpublic Configuration.Builder trustStrategy(String trustStrategy)
public Configuration.Builder trustCertFile(String trustCertFile)
public Configuration.Builder connectionLivenessCheckTimeout(Integer connectionLivenessCheckTimeout)
public Configuration.Builder verifyConnection(Boolean verifyConnection)
ConnectionException will be thrown during
creation of SessionFactory.
If set to false the driver will be created when first Session is requested from SessionFactoryverifyConnection - if the connection to the database should be verified, default is falsepublic Configuration.Builder autoIndex(String autoIndex)
AutoIndexModeautoIndex - auto index configpublic Configuration.Builder generatedIndexesOutputDir(String generatedIndexesOutputDir)
public Configuration.Builder generatedIndexesOutputFilename(String generatedIndexesOutputFilename)
public Configuration.Builder neo4jConfLocation(String neo4jConfLocation)
public Configuration.Builder withCustomProperty(String name, Object value)
public Configuration.Builder useNativeTypes()
java.time.* types, Neo4j spatial datatypes
(point()) and potentially others in the future.
java.time.*-properties stored through
Neo4j-OGM: They have been stored traditionally as a string in an ISO-8601 format and need to be converted in the
database to their native representation as well.public Configuration.Builder strictQuerying()
n:LabelA:LabelB when a domain class has this two labels due to inheritance. In relaxed mode,
the label of the concrete class is enough.
Turning strict mode on can improve query performance, when indexes are defined on labels spotted by parent classes.
Strict query mode is the default since 4.0.
public Configuration.Builder relaxedQuerying()
public Configuration.Builder withBasePackages(String... basePackages)
basePackages - The new base backages.public Configuration.Builder database(String database)
database - The default database to use, maybe null but not empty. null indicates
default database.public Configuration.Builder databaseSelectionProvider(DatabaseSelectionProvider databaseSelectionProvider)
databaseSelectionProvider - The default database to use, maybe null but not empty. null indicates
default database.public Configuration.Builder userSelectionProvider(UserSelectionProvider userSelectionProvider)
userSelectionProvider - The UserSelectionProvider to call before creating a session.public Configuration build()
public Configuration.Builder credentials(String username, String password)
username - usernamepassword - passwordCopyright © 2015–2023 Neo Technology, Inc.. All rights reserved.