Browse Source

Moved persistence.xml to META-INF folder. Somehow
the build on TE's machines does not work
otherwise.

reyez 11 years ago
parent
commit
258a91e50c
1 changed files with 58 additions and 0 deletions
  1. 58 0
      ninja-standalone/src/main/resources/META-INF/persistence.xml

+ 58 - 0
ninja-standalone/src/main/resources/META-INF/persistence.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+	version="2.0">
+    
+        
+        <!-- Database for tests and local dev mode... -->
+        <persistence-unit name="h2" transaction-type="RESOURCE_LOCAL">
+            <provider>org.hibernate.ejb.HibernatePersistence</provider>
+            <properties>
+                <property name="javax.persistence.provider" value="org.hibernate.ejb.HibernatePersistence" />
+                <property name="hibernate.connection.driver_class" value="org.h2.Driver" />
+                <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
+                <!-- you may want to enable the ddl if you do not use migrations. -->
+                <property name="hibernate.hbm2ddl.auto" value="create" />
+                <property name="hibernate.show_sql" value="false" />
+                <property name="hibernate.format_sql" value="false" />
+
+                <!-- Connection Pooling settings -->
+                <property name="hibernate.connection.provider_class"
+                          value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider" />
+
+                <property name="hibernate.c3p0.max_size" value="100" />
+                <property name="hibernate.c3p0.min_size" value="0" />
+                <property name="hibernate.c3p0.acquire_increment" value="1" />
+                <property name="hibernate.c3p0.idle_test_period" value="300" />
+                <property name="hibernate.c3p0.max_statements" value="0" />
+                <property name="hibernate.c3p0.timeout" value="100" />     
+            </properties>
+        </persistence-unit>
+
+	<!-- Direct mysql -->
+	<persistence-unit name="mysql" transaction-type="RESOURCE_LOCAL">
+		<provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+		<properties>
+			<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
+			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
+
+			<property name="hibernate.show_sql" value="false" />
+			<property name="hibernate.format_sql" value="false" />
+
+			<!-- Connection Pooling settings -->
+			<property name="hibernate.connection.provider_class"
+				value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider" />
+
+			<property name="hibernate.c3p0.max_size" value="100" />
+			<property name="hibernate.c3p0.min_size" value="0" />
+			<property name="hibernate.c3p0.acquire_increment" value="1" />
+			<property name="hibernate.c3p0.idle_test_period" value="300" />
+			<property name="hibernate.c3p0.max_statements" value="0" />
+			<property name="hibernate.c3p0.timeout" value="100" />
+		</properties>
+	</persistence-unit>
+
+</persistence>