org.apache.tapestry5.hibernate
Class HibernateModule

java.lang.Object
  extended by org.apache.tapestry5.hibernate.HibernateModule

public class HibernateModule
extends java.lang.Object


Constructor Summary
HibernateModule()
           
 
Method Summary
static void bind(ServiceBinder binder)
           
static HibernateEntityPackageManager buildHibernateEntityPackageManager(java.util.Collection<java.lang.String> packageNames)
           
static HibernateSessionManager buildHibernateSessionManager(HibernateSessionSource sessionSource, PerthreadManager perthreadManager)
          The session manager manages sessions on a per-thread/per-request basis.
static HibernateSessionSource buildHibernateSessionSource(org.slf4j.Logger logger, java.util.List<HibernateConfigurer> config, RegistryShutdownHub hub)
           
static org.hibernate.Session buildSession(HibernateSessionManager sessionManager, PropertyShadowBuilder propertyShadowBuilder)
           
static void contributeAlias(Configuration<AliasContribution> configuration, org.hibernate.Session session)
           
static void contributeComponentClassTransformWorker(OrderedConfiguration<ComponentClassTransformWorker> configuration, ObjectLocator locator)
          Adds the CommitAfter annotation work, to process the CommitAfter annotation.
static void contributeFactoryDefaults(MappedConfiguration<java.lang.String,java.lang.String> configuration)
           
static void contributeHibernateEntityPackageManager(Configuration<java.lang.String> configuration, java.lang.String appRootPackage)
          Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes.
static void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config, HibernateConfigurer defaultHibernateConfigurer, ObjectLocator locator)
          Adds the following configurers: Default performs default hibernate configuration PackageName loads entities by package name
static void contributePersistentFieldManager(MappedConfiguration<java.lang.String,PersistentFieldStrategy> configuration, ObjectLocator locator)
          Contributes the following: entity Stores the id of the entity and reloads from the Session
static void contributeValueEncoderSource(MappedConfiguration<java.lang.Class,ValueEncoderFactory> configuration, boolean provideEncoders, HibernateSessionSource sessionSource, org.hibernate.Session session, TypeCoercer typeCoercer, PropertyAccess propertyAccess, LoggerSource loggerSource)
          Contributes ValueEncoderFactorys for all registered Hibernate entity classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateModule

public HibernateModule()
Method Detail

bind

public static void bind(ServiceBinder binder)

contributeFactoryDefaults

public static void contributeFactoryDefaults(MappedConfiguration<java.lang.String,java.lang.String> configuration)

buildHibernateEntityPackageManager

public static HibernateEntityPackageManager buildHibernateEntityPackageManager(java.util.Collection<java.lang.String> packageNames)

contributeHibernateEntityPackageManager

public static void contributeHibernateEntityPackageManager(Configuration<java.lang.String> configuration,
                                                           @Inject@Symbol(value="tapestry.app-package")
                                                           java.lang.String appRootPackage)
Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes.


buildHibernateSessionManager

@Scope(value="perthread")
public static HibernateSessionManager buildHibernateSessionManager(HibernateSessionSource sessionSource,
                                                                              PerthreadManager perthreadManager)
The session manager manages sessions on a per-thread/per-request basis. A Transaction is created initially, and is committed at the end of the request.


buildSession

public static org.hibernate.Session buildSession(HibernateSessionManager sessionManager,
                                                 PropertyShadowBuilder propertyShadowBuilder)

contributeAlias

public static void contributeAlias(Configuration<AliasContribution> configuration,
                                   @Local
                                   org.hibernate.Session session)

buildHibernateSessionSource

public static HibernateSessionSource buildHibernateSessionSource(org.slf4j.Logger logger,
                                                                 java.util.List<HibernateConfigurer> config,
                                                                 RegistryShutdownHub hub)

contributeHibernateSessionSource

public static void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config,
                                                    @Local
                                                    HibernateConfigurer defaultHibernateConfigurer,
                                                    ObjectLocator locator)
Adds the following configurers:
Default
performs default hibernate configuration
PackageName
loads entities by package name


contributeValueEncoderSource

public static void contributeValueEncoderSource(MappedConfiguration<java.lang.Class,ValueEncoderFactory> configuration,
                                                @Symbol(value="tapestry.hibernate.provide-entity-value-encoders")
                                                boolean provideEncoders,
                                                HibernateSessionSource sessionSource,
                                                org.hibernate.Session session,
                                                TypeCoercer typeCoercer,
                                                PropertyAccess propertyAccess,
                                                LoggerSource loggerSource)
Contributes ValueEncoderFactorys for all registered Hibernate entity classes. Encoding and decoding are based on the id property value of the entity using type coercion. Hence, if the id can be coerced to a String and back then the entity can be coerced.


contributePersistentFieldManager

public static void contributePersistentFieldManager(MappedConfiguration<java.lang.String,PersistentFieldStrategy> configuration,
                                                    ObjectLocator locator)
Contributes the following:
entity
Stores the id of the entity and reloads from the Session


contributeComponentClassTransformWorker

public static void contributeComponentClassTransformWorker(OrderedConfiguration<ComponentClassTransformWorker> configuration,
                                                           ObjectLocator locator)
Adds the CommitAfter annotation work, to process the CommitAfter annotation.



Copyright © 2007-2009 Apache Software Foundation. All Rights Reserved.