项目作者: vasouv

项目描述 :
Demonstration of the embedded H2 database in Payara 5
高级语言: Java
项目地址: git://github.com/vasouv/jpa-h2-payara.git
创建时间: 2018-08-02T09:47:42Z
项目社区:https://github.com/vasouv/jpa-h2-payara

开源协议:

下载


JPA H2 with Payara

Payara 5 has H2 for embedded database instead of Derby. The connection pool is already set up in the server, so if you deploy an app that links to that connection pool you should be good to go.

persistence.xml

  1. <persistence-unit name="h2PU" transaction-type="JTA">
  2. <jta-data-source>jdbc/__default</jta-data-source>
  3. <properties>
  4. <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" ></property>
  5. </properties>
  6. </persistence-unit>

Startup bean

For JAX-RS, the startup bean can be annotated @Startup + @Singleton. For JSF though, the startup bean must be annotated @ApplicationScoped + @Eager (from Omnifaces).