<?xml version="1.0" encoding="UTF-8"?>
<config>
  <ClassMapper>
    <properties method="setPropertyManager">com.riflexo.jcredo.config.PropertyManager</properties>
    <dbschema method="setDBSchema">com.riflexo.jcredo.config.DBSchema</dbschema>
    <core method="setJCredoCore">com.riflexo.jcredo.config.JCredoCore</core>
    <plugins method="setPlugins">com.riflexo.jcredo.config.Plugins</plugins>
    <managed method="setManaged">com.riflexo.jcredo.j2ee.Managed</managed>

    <Aliases>
      <entry>
        <class>com.riflexo.jcredo.config.PropertyPair</class>
      </entry>
      <entry>
        <class>com.riflexo.jcredo.strx.ReflectFactory</class>
        <alias>StrXFactory</alias>
      </entry>
    </Aliases>
    <Decoders>
      <entry>
        <class>com.riflexo.jcredo.config.PropertyPair</class>
        <decoder>com.riflexo.jcredo.config.PropertyPairDecoder</decoder>
      </entry>
    </Decoders>
  </ClassMapper>

  <properties>
	<property>com.riflexo.jcredo.config.hara.connectionTestTimeout=-1</property>
	<property>javax.jdo.option.RetainValues=false</property>

    <property>com.riflexo.jcredo.config.sql.prefetchCount=100<rem>
    Specifies the maximum numbers of rows, fetched from the datastore and cached in memory for faster access.
    If specified as zero, no prefetch will be made.
    If specified as negative integer, the whole result set will be loaded.
    <default>50</default>.
    </rem>
    </property>

    <property>com.riflexo.jcredo.config.sql.syncSchema=false<rem>
    A very neat function to help developers in synchronizing data store schema with current persistence capable classes.
    Make sure to set it to false on any producton system. Although it could be used for 'hot-deployment'
    you are not encouraged to allow such behaviour.
    <default>false</default>.
    </rem>
    </property>

    <property>com.riflexo.jcredo.core.loadKnownClassesOnStart=true<rem>
    Setting this parameter to true will cause all known classes, registered in the RFLX_CLASS_MAPPING table
    to be loaded at the time of first invocation of JDOHelper.getPersistenceManagerFactory(java.util.Properties props).
    This can be useful if classes are not enhanced by JCredo's class-enhacer and there is a getExtent and/or newQuery
    operation prior any of those clases are loaded in JVM, respectively they lack registration in JDOImplHelper and JCredo.
    <default>false</default>.
    </rem>
    </property>

    <property>com.riflexo.jcredo.core.pmPoolSize=7
    <rem>
    Specifies the maximum number of PersistenceManagers cached in the PersistenceManagerFactory.
    <default>7</default>.
    </rem>
    </property>

    <property>com.riflexo.jcredo.config.cache.maxStrongReferencesInCache=171<rem>
    Current cache implementation uses java.lang.ref.SoftReference(s) to keep data. However, it may also be configured
    to keep some number of strong references to 'last recent used' used objects.
    <default>511</default>.
    </rem>
    </property>
    <property>javax.jdo.option.Optimistic=true</property>
  </properties>

  <dbschema>
    <!--
    Contains a list of SQL92 reserved keywords.
    -->
    <include file='SQL92Keywords.xml'/>
    <!--
	Length of column where fully qualified PC class names are stored in.
	-->
    <classIdTableClassNameColumnLength>255</classIdTableClassNameColumnLength>
    <indexNameGenerator>
      <class>com.riflexo.jcredo.dbschema.naming.SimpleNameGenerator</class>
      <!--
	  All generated names could be capitalized, uncapitalized or unchanged
	  -->
      <letterCase>caps</letterCase>
    </indexNameGenerator>

    <!--
    The database dictionary gives details about specific database. Some of the aspects controlled are:
    mapping between Java and SQL types, syntax differences in SQL statements, support of native
    sequencers and  so on. Most of those 'details' are already determined by JCredo. You can set the
    following parameters.
    -->

    <DBDictionary>
      <class>com.riflexo.jcredo.config.DBDictionaryDescr</class>
      <!--If true SQL table creation would follow the order of the fields specified in JDO file. Setting can be overriden per class.-->
      <obeyJDOColumnOrder>true</obeyJDOColumnOrder>
      <!--Forced dictionary class, use it only if JCredo cannot find it automatically or you specify your own implementation.-->
      <dictionaryClass>com.riflexo.jcredo.dbschema.Oracle9iDBDictionary</dictionaryClass>
    </DBDictionary>
	
  </dbschema>

  <core>
    <stringExternalizable>
      <class>com.riflexo.jcredo.strx.InetAddressStrX</class>
    </stringExternalizable>
    <stringExternalizable>
      <class>com.riflexo.jcredo.strx.URLStrX</class>
    </stringExternalizable>
    <stringExternalizable>
      <class>StrXFactory</class>
      <clazz>java.io.File</clazz>
      <from>[init]</from>
      <to>getCanonicalPath</to>
    </stringExternalizable>
    <stringExternalizable>
      <class>StrXFactory</class>
      <clazz>java.text.MessageFormat</clazz>
      <from>[init]</from>
      <to>toPattern</to>
    </stringExternalizable>
    <stringExternalizable>
      <class>com.riflexo.jcredo.strx.ClassStrX</class>
    </stringExternalizable>

    <!--
    Configuration of primary key generation services(sequencers) for datastore identity Persistence Capable.
    All sequencers support maximal key values of java.lang.Long.MAX_VALUE.
    The default sequencer is SysTimeIDSequencer if none of the available is specified.
    Enable one of the following four types of sequencers, implemented in JCredo:
    Note: if you have enabled more than one sequencer, the last one will be used.
    -->
    <sequencer>
      <class>com.riflexo.jcredo.config.IDSequencerDescr</class>

      <!--
      SysTimeIDSequencer: simplest and fastest (in memory only) identity generation.
      It uses the system time to create new keys. Needs no configuration.
      Parameters:
      clusterID - Positive int value in range [0..65535].


        <classname>SysTimeIDSequencer</classname>
        <clusterID>1</clusterID>
      -->

      <!--
      HighLowIDSequencer: uses a dedicated table to generate and store new id-s.
      Each Persistence Capable class has its own sequence(row in the table), which manages its keys.
      Parameters:
      incStep - Specifies the step to increment values of identities in the table. Increasing the value leads
                to few database accesses. Defaults to 20.
      tableName - Specifies the table name to use. Default value is "RFLX_ID_SEQUENCE"(without the quotes).

      <classname>HighLowIDSequencer</classname>
      <incStep>10</incStep>
      <tableName>ID_SEQUENCER</tableName>
      -->

      <!--
      SingleEntityIDSequencer: uses the same technique, used in the HighLowIDSequencer sequencer.
      The key difference is that it uses only one global sequence for all Persistence Capable classes.
      Has the same configuration parameters as the HighLowIDSequencer.
      Parameters:
      incStep - Specifies the step to increment values of identities in the table. Increasing the value leads
                to few database accesses. Defaults to 20.
      tableName - Specifies the table name to use. Default value is "RFLX_ID_SEQUENCE"(without the quotes).

        <classname>SingleEntityIDSequencer</classname>
        <incStep>10</incStep>
        <tableName>GLOBAL_ID_SEQUENCER</tableName>
      -->

      <!--
      DBSequencer: uses database native sequencer, where available(e.g. Oracle, PostgeSQL). One global sequence is used
      for all Persistence Capable classes. The availability of this service is explicitly declared in the database
      dictionary used.
      Parameters:
      tableName - Specifies the sequence name to use. Default value is "RLFX_JCREDO_SEQ"(without the quotes).

      <classname>DBSequencer</classname>
      <tableName>GPW_SEQUENCER</tableName>
  	  <incStep>2</incStep>
      -->
    </sequencer>

    <!--
    Specifies the connection closing policy. Based on the following constants:
    CLOSE_AUTO - autmatically close connection, depending on the environment (managed/non-managed).
      In non-managed environment a connection is closed depending on non-transactional read.
      In managed environment - it is closed on each transaction commit/rollback.
    CLOSE_TRANSACTION - connection will be closed when the current transaction commits/rollbacks.
    CLOSE_PERSISTENCE_MANAGER - connection will be closed when the current PM is closed.
	-->
    <connectionClose>CLOSE_AUTO</connectionClose>
    

    <!--
    Configures the global caching of persistence capables.
    Defaults to true.
    <useL2Cache>false</useL2Cache>
    -->

    <!--
    Configures global flushability of PersistenceManager.
    Defaults to true.
    <canFlush>false</canFlush>
    -->

    <!--
    Configures global caching of queries. L2 Cache must be enabled to use query cache.
    Defaults to true.
    <useQueryCache>false</useQueryCache>
    -->
  </core>

  <managed>
	<allocateHookConnection>true</allocateHookConnection>
	<skipConnectionTest>true</skipConnectionTest>
  </managed>

  <plugins>
	<plugin>
		<class>com.riflexo.jcredo.config.JCAPlugin</class>
		<!-- the JCALicence.jar is expected to be found in user's home directory, or anywhere else with fill path provided -->
		<licenceInfo>${user.home}/JCALicence.jar</licenceInfo>
		<!-- use your unlock or disable in trial versions -->
		<unlock>ABCD1224</unlock>
	</plugin>
  </plugins>

</config>
