|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.com.arsmachina.dao.hibernate.ioc.PersistenceConfiguration
public class PersistenceConfiguration
Class that configures the persistence layer for Spring. Database info is read from a
datasource.properties file in the root of the classpath. Hibernate configuration
properties is read from a hibernate.cfg.xml file, also in the root of the
classpath.
| Field Summary | |
|---|---|
static String |
DATABASE_PASSWORD
Property used to define the database user password. |
static String |
DATABASE_URL
Property used to define the database url. |
static String |
DATABASE_USERNAME
Property used to define the database user name. |
static String |
HIBERNATE_CONFIGURATION_FILE
Location, in the classpath, of the Hibernate configuration file. |
static String |
JDBC_DRIVER
Property used to define the database JDBC driver class name. |
| Constructor Summary | |
|---|---|
PersistenceConfiguration()
Single constructor of this class. |
|
| Method Summary | |
|---|---|
DataSource |
dataSource()
Creates a DataSource. |
String |
getDatabasePassword()
Returns the database user password. |
String |
getDatabaseURL()
Returns the JDBC driver class name. |
String |
getDatabaseUsername()
Returns the database user name. |
String |
getJDBCDriver()
Returns the JDBC driver class name. |
org.hibernate.SessionFactory |
sessionFactory()
Creates a SessionFactory that uses annotations and/or XML for mapping classes. |
org.springframework.transaction.PlatformTransactionManager |
transactionManager()
Creates the PlatformTransactionManager to be used by Spring. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String HIBERNATE_CONFIGURATION_FILE
public static final String DATABASE_URL
public static final String JDBC_DRIVER
public static final String DATABASE_USERNAME
public static final String DATABASE_PASSWORD
| Constructor Detail |
|---|
public PersistenceConfiguration()
| Method Detail |
|---|
public DataSource dataSource()
DataSource.
DataSource.public org.hibernate.SessionFactory sessionFactory()
SessionFactory that uses annotations and/or XML for mapping classes.
SessionFactory.public org.springframework.transaction.PlatformTransactionManager transactionManager()
PlatformTransactionManager to be used by Spring.
HibernateTransactionManager.public String getDatabaseURL()
String.public String getJDBCDriver()
String.public String getDatabaseUsername()
String.public String getDatabasePassword()
String.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||