Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.jpa.conf
Class DefaultDataSourceFactory

    java.lang.Object
      org.apache.cayenne.jpa.conf.DefaultDataSourceFactory

All Implemented Interfaces:
  JpaDataSourceFactory

    public class DefaultDataSourceFactory

extends Object
implements JpaDataSourceFactory

A `JpaDataSourceFactory` that attempts to create a DataSource based on Cayenne provider-specific properties. If such properties are not present, a DataSource is obtained via JNDI.

Properties are specified in the corresponding section of the persistence.xml file. The following properties are supported:

- org.apache.cayenne.datasource.jdbc.driver - (required) JDBC driver class
- org.apache.cayenne.datasource.jdbc.url - (required) Database URL
- org.apache.cayenne.datasource.jdbc.username - Database login id
- org.apache.cayenne.datasource.jdbc.password - Database password
- org.apache.cayenne.datasource.jdbc.minConnections - (optional) Minimal pool size
- org.apache.cayenne.datasource..jdbc.maxConnections - (optional) Maximum pool size

Author:
  Andrus Adamchik

Constructor Summary
`DefaultDataSourceFactory()`

Method Summary
`protected DataSource` | `getCayenneDataSource(Properties properties)`
`protected DataSource` | `getDataSource(String name, javax.persistence.spi.PersistenceUnitInfo info)`
`protected DataSource` | `getJndiDataSource(String name, javax.persistence.spi.PersistenceUnitInfo info)`
`DataSource` | `getJtaDataSource(String name, javax.persistence.spi.PersistenceUnitInfo info)`
`DataSource` | `getNonJtaDataSource(String name, javax.persistence.spi.PersistenceUnitInfo info)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultDataSourceFactory

    public DefaultDataSourceFactory()

Method Detail

### getJtaDataSource

    public DataSource getJtaDataSource(String name,
                                       javax.persistence.spi.PersistenceUnitInfo info)

  Specified by:
    `getJtaDataSource` in interface `JpaDataSourceFactory`

### getNonJtaDataSource

    public DataSource getNonJtaDataSource(String name,
                                          javax.persistence.spi.PersistenceUnitInfo info)

  Specified by:
    `getNonJtaDataSource` in interface `JpaDataSourceFactory`

### getJndiDataSource

    protected DataSource getJndiDataSource(String name,
                                           javax.persistence.spi.PersistenceUnitInfo info)

### getDataSource

    protected DataSource getDataSource(String name,
                                       javax.persistence.spi.PersistenceUnitInfo info)

### getCayenneDataSource

    protected DataSource getCayenneDataSource(Properties properties)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.