Help

Controls

PermLinkWikiLink

Built with Seam

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.

Forum: Seam Users Forum ListTopic List
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?

2 Replies:
19. Mar 2010, 04:35 America/New_York | Link

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.
  }

}

19. Mar 2010, 08:50 America/New_York | Link

i use plain hibernate

where must i store the hibernate.cfg.xml?