Как мне жестко закодировать объект конфигурации в Hibernate?Вот что у меня так далеко;Я надеюсь, что это дает вам представление о том, что я пытаюсь сделать:
Configuration config = new Configuration();
config.addAnnotatedClass(GenericMetadatable.class);
config.addAnnotatedClass(SimpleMetadataValue.class);
config.setProperty("connection.driver_class", "org.h2.Driver")
.setProperty("connection.url", "jdbc:h2:~/test")
.setProperty("connection.username", "sa")
.setProperty("connection.password", "")
.setProperty("hibernate.default_schema", "TESTSCHEMA2")
.setProperty("connection.pool_size", "2")
.setProperty("dialect", "org.hibernate.dialect.H2Dialect")
.setProperty("current_session_context_class", "thread")
.setProperty("cache.provider_class", "net.sf.ehcache.hibernate.EhCacheProvider")
.setProperty("show_sql", "true");
config.addProperties(new Properties() {{}});
config.configure();