Save This Page
Home » spring-framework-2.5.4 » org.springframework » orm » hibernate3 » annotation » [javadoc | source]
org.springframework.orm.hibernate3.annotation
public class: AnnotationSessionFactoryBean [javadoc | source]
java.lang.Object
   org.springframework.orm.hibernate3.AbstractSessionFactoryBean
      org.springframework.orm.hibernate3.LocalSessionFactoryBean
         org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean

All Implemented Interfaces:
    BeanClassLoaderAware, PersistenceExceptionTranslator, DisposableBean, InitializingBean, FactoryBean

Subclass of Spring's standard LocalSessionFactoryBean for Hibernate3, supporting JDK 1.5+ annotation metadata for mappings. Requires the Hibernate3 Annotation add-on to be present.

Example bean definition:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="annotatedClasses">
<list>
<value>test.package.Foo</value>
<value>test.package.Bar</value>
</list>
</property>
<property name="annotatedPackages">
<list>
<value>test.package</value>
</list>
</property>
</bean>
Fields inherited from org.springframework.orm.hibernate3.AbstractSessionFactoryBean:
logger
Constructor:
 public AnnotationSessionFactoryBean() 
Method from org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean Summary:
postProcessAnnotationConfiguration,   postProcessConfiguration,   postProcessMappings,   setAnnotatedClasses,   setAnnotatedPackages,   setConfigurationClass
Methods from org.springframework.orm.hibernate3.LocalSessionFactoryBean:
afterSessionFactoryCreation,   buildSessionFactory,   createDatabaseSchema,   destroy,   dropDatabaseSchema,   executeSchemaScript,   executeSchemaStatement,   getConfigTimeCacheProvider,   getConfigTimeDataSource,   getConfigTimeLobHandler,   getConfigTimeTransactionManager,   getConfiguration,   getHibernateProperties,   newConfiguration,   newSessionFactory,   postProcessConfiguration,   postProcessMappings,   setBeanClassLoader,   setCacheProvider,   setCacheableMappingLocations,   setCollectionCacheStrategies,   setConfigLocation,   setConfigLocations,   setConfigurationClass,   setEntityCacheStrategies,   setEntityInterceptor,   setEventListeners,   setFilterDefinitions,   setHibernateProperties,   setJtaTransactionManager,   setLobHandler,   setMappingDirectoryLocations,   setMappingJarLocations,   setMappingLocations,   setMappingResources,   setNamingStrategy,   setSchemaUpdate,   setTypeDefinitions,   updateDatabaseSchema
Methods from org.springframework.orm.hibernate3.AbstractSessionFactoryBean:
afterPropertiesSet,   afterSessionFactoryCreation,   beforeSessionFactoryDestruction,   buildSessionFactory,   convertHibernateAccessException,   destroy,   getDataSource,   getObject,   getObjectType,   getSessionFactory,   isExposeTransactionAwareSessionFactory,   isSingleton,   isUseTransactionAwareDataSource,   setDataSource,   setExposeTransactionAwareSessionFactory,   setJdbcExceptionTranslator,   setUseTransactionAwareDataSource,   translateExceptionIfPossible,   wrapSessionFactoryIfNecessary
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean Detail:
 protected  void postProcessAnnotationConfiguration(AnnotationConfiguration config) throws HibernateException 
    To be implemented by subclasses that want to to perform custom post-processing of the AnnotationConfiguration object after this FactoryBean performed its default initialization.
 protected final  void postProcessConfiguration(Configuration config) throws HibernateException 
 protected final  void postProcessMappings(Configuration config) throws HibernateException 
    Reads metadata from annotated classes and packages into the AnnotationConfiguration instance.
 public  void setAnnotatedClasses(Class[] annotatedClasses) 
    Specify annotated classes, for which mappings will be read from class-level JDK 1.5+ annotation metadata.
 public  void setAnnotatedPackages(String[] annotatedPackages) 
    Specify the names of annotated packages, for which package-level JDK 1.5+ annotation metadata will be read.
 public  void setConfigurationClass(Class configurationClass)