Sorry for the long story, but I wanted to give a good idea of why we are doing what we are doing.
Currently, our application uses Hibernate 3.6, and we want to upgrade to Hibernate 4.3.
The application was specially written to avoid using persistence.xmlJPA to configure and create, EntityManagerFactoryand instead uses the Hibernate class Ejb3Configuration, like this one (example):
Properties properties = new Properties();
properties.put("javax.persistence.provider", "org.hibernate.ejb.HibernatePersistence");
properties.put("javax.persistence.transactionType", "RESOURCE_LOCAL");
properties.put("hibernate.dialect", "org.hibernate.dialect.Oracle10gDialect");
properties.put("hibernate.show_sql", "false");
properties.put("hibernate.format_sql", "true");
Ejb3Configuration cfg = new Ejb3Configuration();
cfg.addProperties(properties);
DataSource dataSource = dataSourceProvider.get();
cfg.setDataSource(dataSource);
cfg.addAnnotatedClass(SomePersistentObject.class);
EntityManagerFactory factory = cfg.buildEntityManagerFactory();
, , , - ( ), Tomcat, "" . , " ", jar /WEB-INF/lib. " " "" -. , "" , -. , HTTP-.
, , , EntityManagerFactory. , , .
, , JPA Java, - , "" . Java , XML . XML, persistence.xml . copy/paste.
, JPA Java, XML.
: Hibernate 4.3 - ? , ?
, - - , , XML?
jar - /META-INF/persistence.xml, , ?
!!!
-Ryan