Package org.apache.cayenne.runtime
Class CayenneRuntimeBuilder
java.lang.Object
org.apache.cayenne.runtime.CayenneRuntimeBuilder
A convenience class to assemble custom 
CayenneRuntime. It allows to easily
 configure custom modules, multiple config locations, or quickly create a
 global DataSource.- Since:
- 5.0 renamed from ServerRuntimeBuilder and moved to org.apache.cayenne.runtimepackage
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCayenneRuntimeBuilder(String name) Creates a builder with a fixed name of the DataDomain of the resulting CayenneRuntime.
- 
Method SummaryModifier and TypeMethodDescriptionaddConfigs(String... configurationLocations) addConfigs(Collection<String> configurationLocations) addModules(Collection<Module> modules) build()dataSource(DataSource dataSource) Sets a DataSource that will override any DataSources found in the mapping.Disables DI module auto-loading.jdbcDriver(String driver) Sets a driver Java class for the default DataSource.maxConnections(int maxConnections) maxQueueWaitTime(long maxQueueWaitTime) minConnections(int minConnections) Sets a password for the default DataSource.Sets a database URL for the default DataSource.Sets a user name for the default DataSource.validationQuery(String validationQuery) Sets a validation query for the default DataSource.
- 
Constructor Details- 
CayenneRuntimeBuilderCreates a builder with a fixed name of the DataDomain of the resulting CayenneRuntime. Specifying explicit name is often needed for consistency in runtimes merged from multiple configs, each having its own name.
 
- 
- 
Method Details- 
disableModulesAutoLoadingDisables DI module auto-loading. By default, auto-loading is enabled based onModuleLoaderservice provider interface. If you decide to disable auto-loading, make sure you provide all the modules that you need.- Returns:
- this builder instance.
 
- 
dataSourceSets a DataSource that will override any DataSources found in the mapping. If the mapping contains no DataNodes, and the DataSource is set with this method, the builder would create a single default DataNode.- See Also:
 
- 
urlSets a database URL for the default DataSource.
- 
jdbcDriverSets a driver Java class for the default DataSource.
- 
validationQuerySets a validation query for the default DataSource.- Parameters:
- validationQuery- a SQL string that returns some result. It will be used to validate connections in the pool.
 
- 
maxQueueWaitTime
- 
userSets a user name for the default DataSource.
- 
passwordSets a password for the default DataSource.
- 
minConnections
- 
maxConnections
- 
addConfig
- 
addConfigs
- 
addConfigs
- 
addModule
- 
addModules
- 
build
 
-