Package org.apache.cayenne.datasource
Class CayenneDataSource
java.lang.Object
org.apache.cayenne.datasource.CayenneDataSource
An entry point for manually building DataSources. Produces instances of Cayenne own DataSource. Alternatively, you
can use any JDBC-compliant third-party DataSources with Cayenne.
- Since:
- 5.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CayenneDataSource.BuilderfromProperties(Map<String, String> properties) Starts building a DataSource with settings taken from the following map keys: cayenne.jdbc.url cayenne.jdbc.driver cayenne.jdbc.username cayenne.jdbc.password cayenne.jdbc.min_connections cayenne.jdbc.max_connections cayenne.jdbc.max_wait cayenne.jdbc.validation_query The URL property is required.static CayenneDataSource.BuilderfromProperties(Map<String, String> properties, String nodeName) Starts building a DataSource with settings taken from a properties map, same asfromProperties(Map), but first checking properties with a ".nodeName" suffix (e.g.static CayenneDataSource.BuilderStarts building a DataSource for the given database URL.
-
Method Details
-
of
Starts building a DataSource for the given database URL. -
fromProperties
Starts building a DataSource with settings taken from the following map keys:- cayenne.jdbc.url
- cayenne.jdbc.driver
- cayenne.jdbc.username
- cayenne.jdbc.password
- cayenne.jdbc.min_connections
- cayenne.jdbc.max_connections
- cayenne.jdbc.max_wait
- cayenne.jdbc.validation_query
RuntimeProperties.toMap()to pass the runtime properties here. -
fromProperties
public static CayenneDataSource.Builder fromProperties(Map<String, String> properties, String nodeName) Starts building a DataSource with settings taken from a properties map, same asfromProperties(Map), but first checking properties with a ".nodeName" suffix (e.g. "cayenne.jdbc.url.mynode"), and falling back to the unsuffixed ones.
-