org.apache.cayenne.jpa.conf
Class DefaultDataSourceFactory

java.lang.Object
  extended by 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:

Author:
Andrus Adamchik

Constructor Summary
DefaultDataSourceFactory()
           
 
Method Summary
protected  DataSource getCayenneDataSource(String name, Properties properties)
           
protected  DataSource getDataSource(String name, PersistenceUnitInfo info)
           
protected  DataSource getJndiDataSource(String name, PersistenceUnitInfo info)
           
 DataSource getJtaDataSource(String name, PersistenceUnitInfo info)
           
 DataSource getNonJtaDataSource(String name, 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,
                                   PersistenceUnitInfo info)
Specified by:
getJtaDataSource in interface JpaDataSourceFactory

getNonJtaDataSource

public DataSource getNonJtaDataSource(String name,
                                      PersistenceUnitInfo info)
Specified by:
getNonJtaDataSource in interface JpaDataSourceFactory

getJndiDataSource

protected DataSource getJndiDataSource(String name,
                                       PersistenceUnitInfo info)

getDataSource

protected DataSource getDataSource(String name,
                                   PersistenceUnitInfo info)

getCayenneDataSource

protected DataSource getCayenneDataSource(String name,
                                          Properties properties)


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