You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
609 B
27 lines
609 B
package de.kreth.vaadin.clubhelper;
|
|
|
|
import java.util.Properties;
|
|
|
|
import org.hibernate.SessionFactory;
|
|
import org.hibernate.cfg.Configuration;
|
|
|
|
public enum HibernateHolder {
|
|
|
|
INSTANCE;
|
|
private final Configuration configuration;
|
|
|
|
private HibernateHolder() {
|
|
configuration = new Configuration();
|
|
HibernateConfiguration config = new H2MemoryConfiguration();
|
|
config.configure(configuration);
|
|
}
|
|
|
|
public static Properties getProperties() {
|
|
return INSTANCE.configuration.getProperties();
|
|
}
|
|
|
|
public static SessionFactory sessionFactory() {
|
|
return INSTANCE.configuration.buildSessionFactory();
|
|
}
|
|
|
|
}
|
|
|