org.alfresco.repo.domain.schema
Class SchemaBootstrap.SchemaBootstrapConnectionProvider

java.lang.Object
  extended by org.hibernate.connection.UserSuppliedConnectionProvider
      extended by org.alfresco.repo.domain.schema.SchemaBootstrap.SchemaBootstrapConnectionProvider
All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider
Enclosing class:
SchemaBootstrap

public static class SchemaBootstrap.SchemaBootstrapConnectionProvider
extends org.hibernate.connection.UserSuppliedConnectionProvider

This is a workaround for the odd Spring-Hibernate interaction during configuration. The Hibernate code assumes that schema scripts will be generated during context initialization. We want to do it afterwards and have a little more control. Hence this class.

The connection that is used will not be closed or manipulated in any way. This class merely serves to give the connection to Hibernate.


Constructor Summary
SchemaBootstrap.SchemaBootstrapConnectionProvider()
           
 
Method Summary
 void close()
          Unsets the connection.
 void closeConnection(java.sql.Connection conn)
          Does nothing.
 void configure(java.util.Properties props)
          Does nothing.
 java.sql.Connection getConnection()
           
static void setBootstrapConnection(java.sql.Connection connection)
          Set the connection for Hibernate to use for schema generation.
 boolean supportsAggressiveRelease()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaBootstrap.SchemaBootstrapConnectionProvider

public SchemaBootstrap.SchemaBootstrapConnectionProvider()
Method Detail

setBootstrapConnection

public static void setBootstrapConnection(java.sql.Connection connection)
Set the connection for Hibernate to use for schema generation.


close

public void close()
Unsets the connection.

Specified by:
close in interface org.hibernate.connection.ConnectionProvider
Overrides:
close in class org.hibernate.connection.UserSuppliedConnectionProvider

closeConnection

public void closeConnection(java.sql.Connection conn)
Does nothing. The connection was given by a 3rd party and they can close it.

Specified by:
closeConnection in interface org.hibernate.connection.ConnectionProvider
Overrides:
closeConnection in class org.hibernate.connection.UserSuppliedConnectionProvider

configure

public void configure(java.util.Properties props)
               throws org.hibernate.HibernateException
Does nothing.

Specified by:
configure in interface org.hibernate.connection.ConnectionProvider
Overrides:
configure in class org.hibernate.connection.UserSuppliedConnectionProvider
Throws:
org.hibernate.HibernateException

getConnection

public java.sql.Connection getConnection()
Specified by:
getConnection in interface org.hibernate.connection.ConnectionProvider
Overrides:
getConnection in class org.hibernate.connection.UserSuppliedConnectionProvider
See Also:
SchemaBootstrap.SchemaBootstrapConnectionProvider.setBootstrapConnection(Connection)

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
Specified by:
supportsAggressiveRelease in interface org.hibernate.connection.ConnectionProvider
Overrides:
supportsAggressiveRelease in class org.hibernate.connection.UserSuppliedConnectionProvider


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.