Persistence.xml

From NovaOrdis Knowledge Base
Revision as of 19:24, 3 August 2017 by Ovidiu (talk | contribs) (→‎Example)
Jump to navigation Jump to search

Internal

Overview

Example

<?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">
  <persistence-unit name="my-application" transaction-type="JTA">
    <jta-data-source>java:jboss/datasources/mysql-ds</jta-data-source>
    <class>io.novaordis.example.MyEntity</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>

    <shared-cache-mode>ALL</shared-cache-mode>
    <properties>
      <property name="hibernate.default_batch_fetch_size" value="500" />
      <property name="hibernate.cache.use_second_level_cache" value="true" />
      <property name="hibernate.cache.use_query_cache" value="true" />
    </properties>
  </persistence-unit>
</persistence>