public class DefaultHibernate4Factory extends AbstractObjectFactory<org.hibernate.SessionFactory> implements Hibernate4Factory
KEY_DEFAULT
Constructor and Description |
---|
DefaultHibernate4Factory(Configuration configuration,
GriffonApplication application) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeDataSource(String dataSourceName) |
org.hibernate.SessionFactory |
create(String name) |
protected org.hibernate.cfg.Configuration |
createConfiguration(Map<String,Object> config,
String dataSourceName) |
protected void |
createSchema(String dataSourceName,
Map<String,Object> config,
org.hibernate.cfg.Configuration configuration) |
void |
destroy(String name,
org.hibernate.SessionFactory instance) |
Map<String,Object> |
getConfigurationFor(String sessionFactoryName) |
protected DataSource |
getDataSource(String dataSourceName) |
protected String |
getPluralKey() |
Set<String> |
getSessionFactoryNames() |
protected String |
getSingleKey() |
protected org.hibernate.Session |
openSession(String sessionFactoryName,
org.hibernate.SessionFactory sessionFactory) |
event, getApplication, getConfiguration, narrowConfig
@Inject public DefaultHibernate4Factory(@Nonnull @Named(value="hibernate4") Configuration configuration, @Nonnull GriffonApplication application)
@Nonnull public Set<String> getSessionFactoryNames()
getSessionFactoryNames
in interface Hibernate4Factory
@Nonnull public Map<String,Object> getConfigurationFor(@Nonnull String sessionFactoryName)
getConfigurationFor
in interface Hibernate4Factory
@Nonnull protected String getSingleKey()
getSingleKey
in class AbstractObjectFactory<org.hibernate.SessionFactory>
@Nonnull protected String getPluralKey()
getPluralKey
in class AbstractObjectFactory<org.hibernate.SessionFactory>
@Nonnull public org.hibernate.SessionFactory create(@Nonnull String name)
create
in interface ObjectFactory<org.hibernate.SessionFactory>
public void destroy(@Nonnull String name, @Nonnull org.hibernate.SessionFactory instance)
destroy
in interface ObjectFactory<org.hibernate.SessionFactory>
@Nonnull protected org.hibernate.cfg.Configuration createConfiguration(@Nonnull Map<String,Object> config, @Nonnull String dataSourceName)
protected void createSchema(@Nonnull String dataSourceName, @Nonnull Map<String,Object> config, @Nonnull org.hibernate.cfg.Configuration configuration)
@Nonnull protected DataSource getDataSource(@Nonnull String dataSourceName)