You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 11 Members of 9199 |
| Forum: Seam Users |
18. Mar 2010, 20:56 America/New_York | Link |
i use a seamgen generated project.
in our installations we use oracle and sql server
unfortunately in hibernate.cfg.xml there is the sql dialect, so we need two versions, one for oracle and one for sql server.
is there a way to externalize hibernate.cfg.xml?
Are you using plain hibernate or JPA?
For plain hibernate:
<persistence:managed-hibernate-session name="entityManager" session-factory="#{hibernateFactory}" scope="conversation" auto-create="true">JPA:
<persistence:managed-persistence-context name="entityManager" entity-manager-factory="#{entityManagerFactory}" scope="conversation" auto-create="true">Then create a component:
@Name("someComponent") class MyClass { @Factory("hibernateFactory") public SessionFactory factory() { //build session factory from external config and return it. } }i use plain hibernate
where must i store the hibernate.cfg.xml?