<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file configures the OFBiz Entity Engine which JIRA uses to store persist data in a datasource.

For detailed configuration help see:

   http://www.atlassian.com/software/jira/docs/latest/entityengine.html

Or our server specific setup guides (these take you through the setup process for each server):

   http://www.atlassian.com/software/jira/docs/latest/servers/

Normally, you will only need to edit the 'field-type-name' attribute of the <datasource> tag, near the bottom of this
file.

Less commonly, you may wish to change then JNDI lookup paths for:
 - the Transaction Manager (<transaction-factory> element)
 -  Database connection (<jndi-jdbc> element).

If you not using the 12 preconfigured DBs, you may also need to add your own field type definition
-->
<entity-config>
    <resource-loader name="maincp" class="org.ofbiz.core.config.ClasspathLoader"/>

    <!-- TRANSACTION FACTORY - This configures how JIRA finds the application server's transaction management.
    The default ('java:comp/env/UserTransaction') is correct for Tomcat 5.5. For details on configuring for other
    application servers - see:
        http://www.atlassian.com/software/jira/docs/latest/entityengine.html#transactionfactory
    -->
    <transaction-factory class="org.ofbiz.core.entity.transaction.JNDIFactory">
      <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/>
      <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/>
    </transaction-factory>

    <delegator name="default" entity-model-reader="main" entity-group-reader="main">
        <group-map group-name="default" datasource-name="defaultDS"/>
    </delegator>

    <entity-model-reader name="main">
        <resource loader="maincp" location="entitydefs/entitymodel.xml"/>
    </entity-model-reader>

    <entity-group-reader name="main" loader="maincp" location="entitydefs/entitygroup.xml"/>

    <field-type name="cloudscape" loader="maincp" location="entitydefs/fieldtype-cloudscape.xml"/>
    <field-type name="firebird" loader="maincp" location="entitydefs/fieldtype-firebird.xml"/>
    <field-type name="h2" loader="maincp" location="entitydefs/fieldtype-h2.xml"/>
    <field-type name="hsql" loader="maincp" location="entitydefs/fieldtype-hsql18.xml"/>
    <field-type name="mckoidb" loader="maincp" location="entitydefs/fieldtype-mckoidb.xml"/>
    <field-type name="mysql" loader="maincp" location="entitydefs/fieldtype-mysql.xml"/>
    <field-type name="mssql" loader="maincp" location="entitydefs/fieldtype-mssql.xml"/>
    <!--
        This field type is deprecated, and should ONLY be used with Oracle 8i.
        If you are using Oracle 9i or 10g please use Oracle 10g JDBC drivers and the 'oracle10g' field type, which is specified below
    -->
    <field-type name="oracle" loader="maincp" location="entitydefs/fieldtype-oracle.xml"/>
    <!--
        Please use this field type for Oracle 9i and 10g. Please ensure that you are using Oracle 10g JDBC drivers which are compatible with Oracle 9i.
        The 10g JDBC drivers can be downloaded from here: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    -->
    <field-type name="oracle10g" loader="maincp" location="entitydefs/fieldtype-oracle10g.xml"/>
    <field-type name="postgres" loader="maincp" location="entitydefs/fieldtype-postgres.xml"/>
    <field-type name="postgres72" loader="maincp" location="entitydefs/fieldtype-postgres72.xml"/> <!-- use for postgres 7.2 and above -->
    <field-type name="sapdb" loader="maincp" location="entitydefs/fieldtype-sapdb.xml"/>
    <field-type name="sybase" loader="maincp" location="entitydefs/fieldtype-sybase.xml"/>
    <field-type name="db2" loader="maincp" location="entitydefs/fieldtype-db2.xml"/>
    <!--
        JRA-4202: FrontBase has 'type' and 'position' as reserved words so make the following changes the entitymodel.xml
        <field name="type" type="short-varchar"/> to <field name="type" col-name="TYPE_" type="short-varchar"/>
        <field name="type" type="long-varchar"/> to <field name="type" col-name="TYPE_" type="long-varchar"/>
        <field name="position" type="integer"/> to <field name="position" col-name="POSITION_" type="integer"/>
    -->
    <field-type name="frontbase" loader="maincp" location="entitydefs/fieldtype-frontbase.xml"/>
    <!--

    DATASOURCE

    You should no longer define a datasource in this file, the database is now configured through the UI at setup time.
    The only time you would want to configure it here is when you migrate from an older version and need to point the
    new installation at an existing db. This is considered a legacy method and will not work if dbconfig.xml exists
    in the home directory.
     -->
</entity-config>
