public class HibernateSpringSupport extends Object implements OrmSpringSupport<org.hibernate.SessionFactory,org.hibernate.cfg.Configuration>
HibernateModule related actions for the SpringModule.
This support class is only loaded if both the HibernateModule and SpringModule are loaded.
By encapsulating these operations, we remove the strong dependency to spring and the SpringModule from
the HibernateModule. This way, the HibernateModule will still function if spring is not used.| Constructor and Description |
|---|
HibernateSpringSupport() |
| Modifier and Type | Method and Description |
|---|---|
ConfiguredOrmPersistenceUnit<org.hibernate.SessionFactory,org.hibernate.cfg.Configuration> |
getConfiguredPersistenceUnit(Object testObject) |
protected org.springframework.orm.hibernate3.LocalSessionFactoryBean |
getSessionFactoryBean(Object testObject) |
protected SpringModule |
getSpringModule() |
boolean |
isPersistenceUnitConfiguredInSpring(Object testObject) |
public boolean isPersistenceUnitConfiguredInSpring(Object testObject)
isPersistenceUnitConfiguredInSpring in interface OrmSpringSupport<org.hibernate.SessionFactory,org.hibernate.cfg.Configuration>testObject - The test instance, not nullApplicationContext is associated with the given test object,
and if a persistence unit of the type supported by this interface's implementation is availablepublic ConfiguredOrmPersistenceUnit<org.hibernate.SessionFactory,org.hibernate.cfg.Configuration> getConfiguredPersistenceUnit(Object testObject)
getConfiguredPersistenceUnit in interface OrmSpringSupport<org.hibernate.SessionFactory,org.hibernate.cfg.Configuration>testObject - The test instance, not nullConfiguredOrmPersistenceUnit that wraps the persistence unit and the
configuration objectprotected org.springframework.orm.hibernate3.LocalSessionFactoryBean getSessionFactoryBean(Object testObject)
testObject - The test instance, not nullLocalSessionFactoryBean that wraps the configuration of hibernate in springprotected SpringModule getSpringModule()
Copyright © 2016. All Rights Reserved.