Class HibernateModule
java.lang.Object
org.apache.tapestry5.hibernate.web.modules.HibernateModule
Supplements the services defined by
HibernateCoreModule with additional
services and configuration specific to Tapestry web application.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcontributeApplicationStateManager(MappedConfiguration<Class, ApplicationStateContribution> configuration, boolean entitySessionStatePersistenceStrategyEnabled, HibernateSessionSource sessionSource) ContributesApplicationStateContributions for all registered Hibernate entity classes.voidcontributeApplicationStatePersistenceStrategySource(MappedConfiguration<String, ApplicationStatePersistenceStrategy> configuration) Contributes the following strategy: entity Stores the id of the entity and reloads from theSessionstatic voidcontributeFactoryDefaults(MappedConfiguration<String, String> configuration) static voidcontributeHibernateEntityPackageManager(Configuration<String> configuration, String appRootPackage) Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes.static voidContributes the following: entity Stores the id of the entity and reloads from theSessionstatic voidcontributeValueEncoderSource(MappedConfiguration<Class, ValueEncoderFactory> configuration, boolean provideEncoders, HibernateSessionSource sessionSource, org.hibernate.Session session, TypeCoercer typeCoercer, PropertyAccess propertyAccess, LoggerSource loggerSource, org.slf4j.Logger logger) ContributesValueEncoderFactorys for all registered Hibernate entity classes.static voidprovideCommitAfterAnnotationSupport(OrderedConfiguration<ComponentClassTransformWorker2> configuration) Adds the CommitAfter annotation work, to process theCommitAfterannotation.static voidprovideHibernateDashboardTab(OrderedConfiguration<DashboardTab> configuration) static voidprovideInjectableSessionObject(MappedConfiguration<Class, Object> configuration, org.hibernate.Session session) static voidprovideLibraryMapping(Configuration<LibraryMapping> configuration)
-
Constructor Details
-
HibernateModule
public HibernateModule()
-
-
Method Details
-
contributeFactoryDefaults
-
contributeHibernateEntityPackageManager
public static void contributeHibernateEntityPackageManager(Configuration<String> configuration, @Symbol("tapestry.app-package") String appRootPackage) Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes. -
provideInjectableSessionObject
@Contribute(ServiceOverride.class) public static void provideInjectableSessionObject(MappedConfiguration<Class, Object> configuration, @HibernateCore org.hibernate.Session session) -
contributeValueEncoderSource
public static void contributeValueEncoderSource(MappedConfiguration<Class, ValueEncoderFactory> configuration, @Symbol("tapestry.hibernate.provide-entity-value-encoders") boolean provideEncoders, HibernateSessionSource sessionSource, org.hibernate.Session session, TypeCoercer typeCoercer, PropertyAccess propertyAccess, LoggerSource loggerSource, org.slf4j.Logger logger) ContributesValueEncoderFactorys 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<String, PersistentFieldStrategy> configuration) Contributes the following:- entity
- Stores the id of the entity and reloads from the
Session
-
contributeApplicationStatePersistenceStrategySource
public void contributeApplicationStatePersistenceStrategySource(MappedConfiguration<String, ApplicationStatePersistenceStrategy> configuration) Contributes the following strategy:- entity
- Stores the id of the entity and reloads from the
Session
-
contributeApplicationStateManager
public static void contributeApplicationStateManager(MappedConfiguration<Class, ApplicationStateContribution> configuration, @Symbol("tapestry.hibernate.entity-session-state-persistence-strategy-enabled") boolean entitySessionStatePersistenceStrategyEnabled, HibernateSessionSource sessionSource) ContributesApplicationStateContributions for all registered Hibernate entity classes.- Parameters:
configuration- Configuration to contributeentitySessionStatePersistenceStrategyEnabled- indicates if contribution should take placesessionSource- creates Hibernate session
-
provideCommitAfterAnnotationSupport
@Contribute(ComponentClassTransformWorker2.class) @Primary public static void provideCommitAfterAnnotationSupport(OrderedConfiguration<ComponentClassTransformWorker2> configuration) Adds the CommitAfter annotation work, to process theCommitAfterannotation. -
provideHibernateDashboardTab
@Contribute(DashboardManager.class) public static void provideHibernateDashboardTab(OrderedConfiguration<DashboardTab> configuration) -
provideLibraryMapping
@Contribute(ComponentClassResolver.class) public static void provideLibraryMapping(Configuration<LibraryMapping> configuration)
-