PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/jcg-andygene-web-archetype/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml

http://jcg-andygene-web.googlecode.com/
XML | 44 lines | 28 code | 0 blank | 16 comment | 0 complexity | adff66e3fb6f453f5dd3a2738a2981c3 MD5 | raw file
 1#set( $symbol_pound = '#' )
 2#set( $symbol_dollar = '$' )
 3#set( $symbol_escape = '\' )
 4<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 5<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
 6<persistence-unit name="myUnit" transaction-type="RESOURCE_LOCAL">
 7        <provider>org.hibernate.ejb.HibernatePersistence</provider>
 8        <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
 9        <properties>
10        	#if( $db == "h2" )
11            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/-->
12            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/-->
13            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/-->
14            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
15            #elseif( $db == "mysql" )
16            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/-->
17            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
18            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/-->
19            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/-->
20            #elseif( $db == "postgres")
21            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
22            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/-->
23            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/-->
24            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/-->
25            #else
26            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/-->
27            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/-->
28            <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
29            <!-- property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/-->
30            #end
31            <!-- value="create" to build a new database on each run; value="update" to modify an existing database; value="create-drop" means the same as "create" but also drops tables when Hibernate closes; value="validate" makes no changes to the database -->
32            <property name="hibernate.hbm2ddl.auto" value="update"/>
33            <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/>
34            <property name="hibernate.connection.charSet" value="UTF-8"/>
35            <property name="hibernate.show_sql" value="true"/>
36            <property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory"/>
37            <property name="hibernate.cache.use_second_level_cache" value="true"/>
38            <property name="hibernate.cache.use_query_cache" value="true"/> 
39            <!-- Uncomment the following two properties for JBoss only -->
40            <!-- property name="hibernate.validator.apply_to_ddl" value="false" /-->
41            <!-- property name="hibernate.validator.autoregister_listeners" value="false" /-->
42        </properties>
43    </persistence-unit>
44</persistence>