org.codehaus.groovy.grails.orm.hibernate
Class SessionFactoryProxy

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy
All Implemented Interfaces:
groovy.lang.GroovyObject, java.io.Serializable, javax.naming.Referenceable, org.hibernate.engine.Mapping, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.SessionFactory, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.core.InfrastructureProxy

public class SessionFactoryProxy
extends groovy.lang.GroovyObjectSupport
implements org.hibernate.SessionFactory, org.hibernate.engine.SessionFactoryImplementor, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.InfrastructureProxy

Proxies the SessionFactory allowing for the underlying SessionFactory instance to be replaced at runtime. Used to enable rebuilding of the SessionFactory at development time

NOTE: This class is not for production use and is development time only!

Since:
2.0
See Also:
Serialized Form

Constructor Summary
SessionFactoryProxy()
           
 
Method Summary
 void afterPropertiesSet()
           
 void close()
           
 boolean containsFetchProfileDefinition(java.lang.String name)
           
protected  org.hibernate.context.CurrentSessionContext createCurrentSessionContext()
           
 void evict(java.lang.Class persistentClass)
          Deprecated. 
 void evict(java.lang.Class persistentClass, java.io.Serializable id)
          Deprecated. 
 void evictCollection(java.lang.String roleName)
          Deprecated. 
 void evictCollection(java.lang.String roleName, java.io.Serializable id)
          Deprecated. 
 void evictEntity(java.lang.String entityName)
          Deprecated. 
 void evictEntity(java.lang.String entityName, java.io.Serializable id)
          Deprecated. 
 void evictQueries()
          Deprecated. 
 void evictQueries(java.lang.String cacheRegion)
          Deprecated. 
 java.util.Map<java.lang.String,org.hibernate.metadata.ClassMetadata> getAllClassMetadata()
           
 java.util.Map getAllCollectionMetadata()
           
 java.util.Map getAllSecondLevelCacheRegions()
           
 org.hibernate.Cache getCache()
           
 org.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.Class entityClass)
           
 org.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.String entityName)
           
 org.hibernate.metadata.CollectionMetadata getCollectionMetadata(java.lang.String roleName)
           
 org.hibernate.persister.collection.CollectionPersister getCollectionPersister(java.lang.String role)
           
 java.util.Set<java.lang.String> getCollectionRolesByEntityParticipant(java.lang.String entityName)
           
 org.hibernate.connection.ConnectionProvider getConnectionProvider()
           
 org.hibernate.classic.Session getCurrentSession()
           
 org.hibernate.SessionFactory getCurrentSessionFactory()
           
 org.hibernate.engine.SessionFactoryImplementor getCurrentSessionFactoryImplementor()
           
 java.util.Set getDefinedFilterNames()
           
 org.hibernate.dialect.Dialect getDialect()
           
 org.hibernate.proxy.EntityNotFoundDelegate getEntityNotFoundDelegate()
           
 org.hibernate.persister.entity.EntityPersister getEntityPersister(java.lang.String entityName)
           
 org.hibernate.SessionFactoryObserver getFactoryObserver()
           
 org.hibernate.engine.profile.FetchProfile getFetchProfile(java.lang.String name)
           
 org.hibernate.engine.FilterDefinition getFilterDefinition(java.lang.String filterName)
           
 org.hibernate.id.IdentifierGenerator getIdentifierGenerator(java.lang.String rootEntityName)
           
 org.hibernate.id.factory.IdentifierGeneratorFactory getIdentifierGeneratorFactory()
          Deprecated. 
 java.lang.String getIdentifierPropertyName(java.lang.String className)
           
 org.hibernate.type.Type getIdentifierType(java.lang.String className)
           
 java.lang.String[] getImplementors(java.lang.String className)
           
 java.lang.String getImportedClassName(java.lang.String name)
           
 org.hibernate.Interceptor getInterceptor()
           
 org.hibernate.engine.NamedQueryDefinition getNamedQuery(java.lang.String queryName)
           
 org.hibernate.engine.NamedSQLQueryDefinition getNamedSQLQuery(java.lang.String queryName)
           
 java.util.Properties getProperties()
           
 java.lang.Object getProperty(java.lang.String property)
           
 org.hibernate.cache.QueryCache getQueryCache()
           
 org.hibernate.cache.QueryCache getQueryCache(java.lang.String regionName)
           
 org.hibernate.engine.query.QueryPlanCache getQueryPlanCache()
           
 javax.naming.Reference getReference()
           
 org.hibernate.type.Type getReferencedPropertyType(java.lang.String className, java.lang.String propertyName)
           
 org.hibernate.engine.ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
           
 java.lang.String[] getReturnAliases(java.lang.String queryString)
           
 org.hibernate.type.Type[] getReturnTypes(java.lang.String queryString)
           
 org.hibernate.cache.Region getSecondLevelCacheRegion(java.lang.String regionName)
           
 org.hibernate.cfg.Settings getSettings()
           
 org.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()
           
 org.hibernate.dialect.function.SQLFunctionRegistry getSqlFunctionRegistry()
           
 org.hibernate.stat.Statistics getStatistics()
           
 org.hibernate.stat.StatisticsImplementor getStatisticsImplementor()
           
 javax.transaction.TransactionManager getTransactionManager()
           
 org.hibernate.TypeHelper getTypeHelper()
           
 org.hibernate.type.TypeResolver getTypeResolver()
           
 org.hibernate.cache.UpdateTimestampsCache getUpdateTimestampsCache()
           
 java.lang.Object getWrappedObject()
           
 boolean isClosed()
           
 org.hibernate.classic.Session openSession()
           
 org.hibernate.classic.Session openSession(java.sql.Connection connection)
           
 org.hibernate.classic.Session openSession(java.sql.Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, org.hibernate.ConnectionReleaseMode connectionReleaseMode)
           
 org.hibernate.classic.Session openSession(java.sql.Connection connection, org.hibernate.Interceptor interceptor)
           
 org.hibernate.classic.Session openSession(org.hibernate.Interceptor interceptor)
           
 org.hibernate.StatelessSession openStatelessSession()
           
 org.hibernate.StatelessSession openStatelessSession(java.sql.Connection connection)
           
 org.hibernate.classic.Session openTemporarySession()
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setCurrentSessionContextClass(java.lang.Class currentSessionContextClass)
          The class to use for the current session context
 void setTargetBean(java.lang.String targetBean)
          The target bean to proxy
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactoryProxy

public SessionFactoryProxy()
Method Detail

setTargetBean

public void setTargetBean(java.lang.String targetBean)
The target bean to proxy

Parameters:
targetBean - The name of the target bean

getProperty

public java.lang.Object getProperty(java.lang.String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class groovy.lang.GroovyObjectSupport

setCurrentSessionContextClass

public void setCurrentSessionContextClass(java.lang.Class currentSessionContextClass)
The class to use for the current session context

Parameters:
currentSessionContextClass - The current session context class

getCurrentSessionFactory

public org.hibernate.SessionFactory getCurrentSessionFactory()
Returns:
The current SessionFactory being proxied

getCurrentSessionFactoryImplementor

public org.hibernate.engine.SessionFactoryImplementor getCurrentSessionFactoryImplementor()
Returns:
The current SessionFactoryImplementor being proxied

openSession

public org.hibernate.classic.Session openSession()
                                          throws org.hibernate.HibernateException
Specified by:
openSession in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

openSession

public org.hibernate.classic.Session openSession(org.hibernate.Interceptor interceptor)
                                          throws org.hibernate.HibernateException
Specified by:
openSession in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

openSession

public org.hibernate.classic.Session openSession(java.sql.Connection connection)
Specified by:
openSession in interface org.hibernate.SessionFactory

openSession

public org.hibernate.classic.Session openSession(java.sql.Connection connection,
                                                 org.hibernate.Interceptor interceptor)
Specified by:
openSession in interface org.hibernate.SessionFactory

getCurrentSession

public org.hibernate.classic.Session getCurrentSession()
                                                throws org.hibernate.HibernateException
Specified by:
getCurrentSession in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

openStatelessSession

public org.hibernate.StatelessSession openStatelessSession()
Specified by:
openStatelessSession in interface org.hibernate.SessionFactory

openStatelessSession

public org.hibernate.StatelessSession openStatelessSession(java.sql.Connection connection)
Specified by:
openStatelessSession in interface org.hibernate.SessionFactory

getClassMetadata

public org.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.Class entityClass)
Specified by:
getClassMetadata in interface org.hibernate.SessionFactory

getClassMetadata

public org.hibernate.metadata.ClassMetadata getClassMetadata(java.lang.String entityName)
Specified by:
getClassMetadata in interface org.hibernate.SessionFactory

getCollectionMetadata

public org.hibernate.metadata.CollectionMetadata getCollectionMetadata(java.lang.String roleName)
Specified by:
getCollectionMetadata in interface org.hibernate.SessionFactory

getAllClassMetadata

public java.util.Map<java.lang.String,org.hibernate.metadata.ClassMetadata> getAllClassMetadata()
Specified by:
getAllClassMetadata in interface org.hibernate.SessionFactory

getAllCollectionMetadata

public java.util.Map getAllCollectionMetadata()
Specified by:
getAllCollectionMetadata in interface org.hibernate.SessionFactory

getStatistics

public org.hibernate.stat.Statistics getStatistics()
Specified by:
getStatistics in interface org.hibernate.SessionFactory

close

public void close()
           throws org.hibernate.HibernateException
Specified by:
close in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

isClosed

public boolean isClosed()
Specified by:
isClosed in interface org.hibernate.SessionFactory

getCache

public org.hibernate.Cache getCache()
Specified by:
getCache in interface org.hibernate.SessionFactory

evict

@Deprecated
public void evict(java.lang.Class persistentClass)
           throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evict in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evict

@Deprecated
public void evict(java.lang.Class persistentClass,
                             java.io.Serializable id)
           throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evict in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictEntity

@Deprecated
public void evictEntity(java.lang.String entityName)
                 throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictEntity in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictEntity

@Deprecated
public void evictEntity(java.lang.String entityName,
                                   java.io.Serializable id)
                 throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictEntity in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictCollection

@Deprecated
public void evictCollection(java.lang.String roleName)
                     throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictCollection in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictCollection

@Deprecated
public void evictCollection(java.lang.String roleName,
                                       java.io.Serializable id)
                     throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictCollection in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictQueries

@Deprecated
public void evictQueries(java.lang.String cacheRegion)
                  throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictQueries in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

evictQueries

@Deprecated
public void evictQueries()
                  throws org.hibernate.HibernateException
Deprecated. 

Specified by:
evictQueries in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

getDefinedFilterNames

public java.util.Set getDefinedFilterNames()
Specified by:
getDefinedFilterNames in interface org.hibernate.SessionFactory

getFilterDefinition

public org.hibernate.engine.FilterDefinition getFilterDefinition(java.lang.String filterName)
                                                          throws org.hibernate.HibernateException
Specified by:
getFilterDefinition in interface org.hibernate.SessionFactory
Throws:
org.hibernate.HibernateException

containsFetchProfileDefinition

public boolean containsFetchProfileDefinition(java.lang.String name)
Specified by:
containsFetchProfileDefinition in interface org.hibernate.SessionFactory

getTypeHelper

public org.hibernate.TypeHelper getTypeHelper()
Specified by:
getTypeHelper in interface org.hibernate.SessionFactory

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getTypeResolver

public org.hibernate.type.TypeResolver getTypeResolver()
Specified by:
getTypeResolver in interface org.hibernate.engine.SessionFactoryImplementor

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface org.hibernate.engine.SessionFactoryImplementor

getEntityPersister

public org.hibernate.persister.entity.EntityPersister getEntityPersister(java.lang.String entityName)
                                                                  throws org.hibernate.MappingException
Specified by:
getEntityPersister in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.MappingException

getCollectionPersister

public org.hibernate.persister.collection.CollectionPersister getCollectionPersister(java.lang.String role)
                                                                              throws org.hibernate.MappingException
Specified by:
getCollectionPersister in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.MappingException

getDialect

public org.hibernate.dialect.Dialect getDialect()
Specified by:
getDialect in interface org.hibernate.engine.SessionFactoryImplementor

getInterceptor

public org.hibernate.Interceptor getInterceptor()
Specified by:
getInterceptor in interface org.hibernate.engine.SessionFactoryImplementor

getQueryPlanCache

public org.hibernate.engine.query.QueryPlanCache getQueryPlanCache()
Specified by:
getQueryPlanCache in interface org.hibernate.engine.SessionFactoryImplementor

getReturnTypes

public org.hibernate.type.Type[] getReturnTypes(java.lang.String queryString)
                                         throws org.hibernate.HibernateException
Specified by:
getReturnTypes in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.HibernateException

getReturnAliases

public java.lang.String[] getReturnAliases(java.lang.String queryString)
                                    throws org.hibernate.HibernateException
Specified by:
getReturnAliases in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.HibernateException

getConnectionProvider

public org.hibernate.connection.ConnectionProvider getConnectionProvider()
Specified by:
getConnectionProvider in interface org.hibernate.engine.SessionFactoryImplementor

getImplementors

public java.lang.String[] getImplementors(java.lang.String className)
                                   throws org.hibernate.MappingException
Specified by:
getImplementors in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.MappingException

getImportedClassName

public java.lang.String getImportedClassName(java.lang.String name)
Specified by:
getImportedClassName in interface org.hibernate.engine.SessionFactoryImplementor

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Specified by:
getTransactionManager in interface org.hibernate.engine.SessionFactoryImplementor

getQueryCache

public org.hibernate.cache.QueryCache getQueryCache()
Specified by:
getQueryCache in interface org.hibernate.engine.SessionFactoryImplementor

getQueryCache

public org.hibernate.cache.QueryCache getQueryCache(java.lang.String regionName)
                                             throws org.hibernate.HibernateException
Specified by:
getQueryCache in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.HibernateException

getUpdateTimestampsCache

public org.hibernate.cache.UpdateTimestampsCache getUpdateTimestampsCache()
Specified by:
getUpdateTimestampsCache in interface org.hibernate.engine.SessionFactoryImplementor

getStatisticsImplementor

public org.hibernate.stat.StatisticsImplementor getStatisticsImplementor()
Specified by:
getStatisticsImplementor in interface org.hibernate.engine.SessionFactoryImplementor

getNamedQuery

public org.hibernate.engine.NamedQueryDefinition getNamedQuery(java.lang.String queryName)
Specified by:
getNamedQuery in interface org.hibernate.engine.SessionFactoryImplementor

getNamedSQLQuery

public org.hibernate.engine.NamedSQLQueryDefinition getNamedSQLQuery(java.lang.String queryName)
Specified by:
getNamedSQLQuery in interface org.hibernate.engine.SessionFactoryImplementor

getResultSetMapping

public org.hibernate.engine.ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
Specified by:
getResultSetMapping in interface org.hibernate.engine.SessionFactoryImplementor

getIdentifierGenerator

public org.hibernate.id.IdentifierGenerator getIdentifierGenerator(java.lang.String rootEntityName)
Specified by:
getIdentifierGenerator in interface org.hibernate.engine.SessionFactoryImplementor

getSecondLevelCacheRegion

public org.hibernate.cache.Region getSecondLevelCacheRegion(java.lang.String regionName)
Specified by:
getSecondLevelCacheRegion in interface org.hibernate.engine.SessionFactoryImplementor

getAllSecondLevelCacheRegions

public java.util.Map getAllSecondLevelCacheRegions()
Specified by:
getAllSecondLevelCacheRegions in interface org.hibernate.engine.SessionFactoryImplementor

getSQLExceptionConverter

public org.hibernate.exception.SQLExceptionConverter getSQLExceptionConverter()
Specified by:
getSQLExceptionConverter in interface org.hibernate.engine.SessionFactoryImplementor

getSettings

public org.hibernate.cfg.Settings getSettings()
Specified by:
getSettings in interface org.hibernate.engine.SessionFactoryImplementor

openTemporarySession

public org.hibernate.classic.Session openTemporarySession()
                                                   throws org.hibernate.HibernateException
Specified by:
openTemporarySession in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.HibernateException

openSession

public org.hibernate.classic.Session openSession(java.sql.Connection connection,
                                                 boolean flushBeforeCompletionEnabled,
                                                 boolean autoCloseSessionEnabled,
                                                 org.hibernate.ConnectionReleaseMode connectionReleaseMode)
                                          throws org.hibernate.HibernateException
Specified by:
openSession in interface org.hibernate.engine.SessionFactoryImplementor
Throws:
org.hibernate.HibernateException

getCollectionRolesByEntityParticipant

public java.util.Set<java.lang.String> getCollectionRolesByEntityParticipant(java.lang.String entityName)
Specified by:
getCollectionRolesByEntityParticipant in interface org.hibernate.engine.SessionFactoryImplementor

getEntityNotFoundDelegate

public org.hibernate.proxy.EntityNotFoundDelegate getEntityNotFoundDelegate()
Specified by:
getEntityNotFoundDelegate in interface org.hibernate.engine.SessionFactoryImplementor

getSqlFunctionRegistry

public org.hibernate.dialect.function.SQLFunctionRegistry getSqlFunctionRegistry()
Specified by:
getSqlFunctionRegistry in interface org.hibernate.engine.SessionFactoryImplementor

getFetchProfile

public org.hibernate.engine.profile.FetchProfile getFetchProfile(java.lang.String name)
Specified by:
getFetchProfile in interface org.hibernate.engine.SessionFactoryImplementor

getFactoryObserver

public org.hibernate.SessionFactoryObserver getFactoryObserver()
Specified by:
getFactoryObserver in interface org.hibernate.engine.SessionFactoryImplementor

getIdentifierGeneratorFactory

@Deprecated
public org.hibernate.id.factory.IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Deprecated. 

Specified by:
getIdentifierGeneratorFactory in interface org.hibernate.engine.Mapping

getIdentifierType

public org.hibernate.type.Type getIdentifierType(java.lang.String className)
                                          throws org.hibernate.MappingException
Specified by:
getIdentifierType in interface org.hibernate.engine.Mapping
Throws:
org.hibernate.MappingException

getIdentifierPropertyName

public java.lang.String getIdentifierPropertyName(java.lang.String className)
                                           throws org.hibernate.MappingException
Specified by:
getIdentifierPropertyName in interface org.hibernate.engine.Mapping
Throws:
org.hibernate.MappingException

getReferencedPropertyType

public org.hibernate.type.Type getReferencedPropertyType(java.lang.String className,
                                                         java.lang.String propertyName)
                                                  throws org.hibernate.MappingException
Specified by:
getReferencedPropertyType in interface org.hibernate.engine.Mapping
Throws:
org.hibernate.MappingException

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

createCurrentSessionContext

protected org.hibernate.context.CurrentSessionContext createCurrentSessionContext()

getWrappedObject

public java.lang.Object getWrappedObject()
Specified by:
getWrappedObject in interface org.springframework.core.InfrastructureProxy