Class HibernateCoreModule
- java.lang.Object
-
- org.apache.tapestry5.hibernate.modules.HibernateCoreModule
-
@Marker(HibernateCore.class) public class HibernateCoreModule extends Object
Defines core services that support initialization of Hibernate and access to the HibernateSession
.
-
-
Constructor Summary
Constructors Constructor Description HibernateCoreModule()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
bind(ServiceBinder binder)
static HibernateEntityPackageManager
buildHibernateEntityPackageManager(Collection<String> packageNames)
static HibernateSessionManager
buildHibernateSessionManager(HibernateSessionSource sessionSource, PerthreadManager perthreadManager)
The session manager manages sessions on a per-thread/per-request basis.static org.hibernate.Session
buildSession(HibernateSessionManager sessionManager, PropertyShadowBuilder propertyShadowBuilder)
static void
contributeFactoryDefaults(MappedConfiguration<String,String> configuration)
static void
contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config, HibernateConfigurer defaultHibernateConfigurer)
Adds the following configurers: Default performs default hibernate configuration PackageName loads entities by package namestatic void
contributeRegistryStartup(OrderedConfiguration<Runnable> configuration, boolean earlyStartup, HibernateSessionSource sessionSource)
-
-
-
Constructor Detail
-
HibernateCoreModule
public HibernateCoreModule()
-
-
Method Detail
-
bind
public static void bind(ServiceBinder binder)
-
contributeFactoryDefaults
public static void contributeFactoryDefaults(MappedConfiguration<String,String> configuration)
-
contributeRegistryStartup
public static void contributeRegistryStartup(OrderedConfiguration<Runnable> configuration, @Symbol("tapestry.hibernate.early-startup") boolean earlyStartup, HibernateSessionSource sessionSource)
-
buildHibernateEntityPackageManager
public static HibernateEntityPackageManager buildHibernateEntityPackageManager(Collection<String> packageNames)
-
buildHibernateSessionManager
@Scope("perthread") public static HibernateSessionManager buildHibernateSessionManager(HibernateSessionSource sessionSource, PerthreadManager perthreadManager)
The session manager manages sessions on a per-thread/per-request basis. Any active transaction will be rolled back at thread cleanup time. The thread is cleaned up automatically in a Tapestry web application.
-
buildSession
public static org.hibernate.Session buildSession(HibernateSessionManager sessionManager, PropertyShadowBuilder propertyShadowBuilder)
-
contributeHibernateSessionSource
public static void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config, @Local HibernateConfigurer defaultHibernateConfigurer)
Adds the following configurers:- Default
- performs default hibernate configuration
- PackageName
- loads entities by package name
-
-