Cayenne User Documentation
JPA Cayenne Provider Properties

JPA specification supports arbitrary persistence unit properties that can be interpreted by the provider. Cayenne recognizes a number of properties, all of which start with `"org.apache.cayenne."` prefix:

Property | Description | Default
--- | --- | ---
org.apache.cayenne.schema.create | If true, Cayenne provider will check for the existing schema, and if it is absent, will create it. Note that it is useful to quickly bootstrap your application, but Cayenne will make no attempt to upgrade an existing schema | false
org.apache.cayenne.datasource.jdbc.driver | JDBC Driver class of a non-JTA DataSource. |
org.apache.cayenne.datasource.jdbc.url | Database URL of a non-JTA DataSource. |
org.apache.cayenne.datasource.jdbc.username | Database user name of a non-JTA DataSource. |
org.apache.cayenne.datasource.jdbc.password | Database password of a non-JTA DataSource. |
org.apache.cayenne.datasource.jdbc.minConnections | Min pool size of a non-JTA DataSource. | 1
org.apache.cayenne.datasource.jdbc.maxConnections | Max pool size of a non-JTA DataSource. | 1
org.apache.cayenne.adapter | Cayenne DbAdapter class. Generally not required as Cayenne can guess the database type in runtime. | org.apache.cayenne.dba.AutoAdapter

### Examples

- Configuring application-managed DataSource:

persistence.xml

    <persistence>
    	<persistence-unit name="jpa-webapp-example">
    		<properties>
    			<property name="org.apache.cayenne.datasource.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
    			<property name="org.apache.cayenne.datasource.jdbc.url" value="jdbc:derby:cayenne/jpa-web-example;create=true"/>
    			<property name="org.apache.cayenne.datasource.jdbc.username" value="test"/>
    			<property name="org.apache.cayenne.datasource.jdbc.password" value="secret"/>
    			<property name="org.apache.cayenne.datasource.jdbc.minConnections" value="1"/>
    			<property name="org.apache.cayenne.datasource.jdbc.maxConnections" value="2"/>
    		</properties>
    	</persistence-unit>
    </persistence>

.
Copyright ©2001-2007 Apache Software Foundation