| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>4. Database Support</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA 1.2 User's Guide"><link rel="up" href="ref_guide_dbsetup.html" title="Chapter 4. JDBC"><link rel="prev" href="ref_guide_dbsetup_sqlconn.html" title="3. Runtime Access to DataSource"><link rel="next" href="ref_guide_dbsetup_isolation.html" title="5. Setting the Transaction Isolation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. |
| Database Support |
| </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_dbsetup_sqlconn.html">Prev</a> </td><th width="60%" align="center">Chapter 4. |
| JDBC |
| </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_dbsetup_isolation.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref_guide_dbsetup_dbsupport"></a>4. |
| Database Support |
| </h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ref_guide_dbsetup_dbsupport.html#ref_guide_dbsetup_dbdictprops">4.1. |
| DBDictionary Properties |
| </a></span></dt><dt><span class="section"><a href="ref_guide_dbsetup_dbsupport.html#ref_guide_dbsetup_dbsupport_mysql">4.2. |
| MySQLDictionary Properties |
| </a></span></dt><dt><span class="section"><a href="ref_guide_dbsetup_dbsupport.html#ref_guide_dbsetup_dbsupport_oracle">4.3. |
| OracleDictionary Properties |
| </a></span></dt></dl></div><a class="indexterm" name="d0e17706"></a><a class="indexterm" name="d0e17709"></a><p> |
| OpenJPA can take advantage of any JDBC 2.x compliant |
| driver, making almost any major database a candidate for use. See our officially |
| supported database list in <a href="supported_databases.html" title="Appendix 2. Supported Databases">Appendix 2, <i xmlns:xlink="http://www.w3.org/1999/xlink"> |
| Supported Databases |
| </i></a> for more |
| information. Typically, OpenJPA auto-configures its JDBC behavior and SQL |
| dialect for your database, based on the values of your connection-related |
| configuration properties. |
| </p><p> |
| If OpenJPA cannot detect what type of database you are using, or if you are |
| using an unsupported database, you will have to tell OpenJPA what |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/DBDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.DBDictionary</code></a> to use. |
| The <code class="classname">DBDictionary</code> abstracts away the differences between |
| databases. You can plug a dictionary into OpenJPA using the |
| <a href="ref_guide_conf_jdbc.html#openjpa.jdbc.DBDictionary" title="6.2. openjpa.jdbc.DBDictionary"><code class="literal">openjpa.jdbc.DBDictionary |
| </code></a> configuration property. The built-in dictionaries are listed |
| below. If you are using an unsupported database, you may have to write your own |
| <code class="classname">DBDictionary</code> subclass, a simple process. |
| </p><div class="itemizedlist"><ul type="disc"><li><p> |
| <a class="indexterm" name="d0e17741"></a> |
| <code class="literal">access</code>: Dictionary for Microsoft Access. This is an alias |
| for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/AccessDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.AccessDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17756"></a> |
| <code class="literal">db2</code>: Dictionary for IBM's DB2 database. This is an alias for |
| the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/DB2Dictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.DB2Dictionary</code></a> class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17771"></a> |
| <code class="literal">derby</code>: Dictionary for the Apache Derby database. This is an |
| alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/DerbyDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.DerbyDictionary</code> class. |
| </a> |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17787"></a> |
| <code class="literal">empress</code>: Dictionary for Empress database This is an alias |
| for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/EmpressDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.EmpressDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17802"></a> |
| <code class="literal">foxpro</code>: Dictionary for Microsoft Visual FoxPro. This is an |
| alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/FoxProDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.FoxProDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17817"></a> |
| <code class="literal">hsql</code>: Dictionary for the Hypersonic SQL database. This is an |
| alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/HSQLDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.HSQLDictionary</code></a> class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17832"></a> |
| <code class="literal">informix</code>: Dictionary for the Informix database. This is an |
| alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/InformixDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.InformixDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17847"></a> |
| <code class="literal">jdatastore</code>: Dictionary for Borland JDataStore. This is an |
| alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/JDataStoreDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.JDataStoreDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17862"></a> |
| <code class="literal">mysql</code>: Dictionary for the MySQL database. This is an alias |
| for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/MySQLDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.MySQLDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17877"></a> |
| <code class="literal">oracle</code>: Dictionary for Oracle. This is an alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/OracleDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.OracleDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17892"></a> |
| <code class="literal">pointbase</code>: Dictionary for Pointbase Embedded database. This |
| is an alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/PointbaseDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.PointbaseDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17907"></a> |
| <code class="literal">postgres</code>: Dictionary for PostgreSQL. This is an alias for |
| the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/PostgresDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.PostgresDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17922"></a> |
| <code class="literal">sqlserver</code>: Dictionary for Microsoft's SQLServer database. |
| This is an alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/SQLServerDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.SQLServerDictionary</code></a> |
| class. |
| </p></li><li><p> |
| <a class="indexterm" name="d0e17937"></a> |
| <code class="literal">sybase</code>: Dictionary for Sybase. This is an alias for the |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="../javadoc/org/apache/openjpa/jdbc/sql/SybaseDictionary.html" target="_top"> |
| <code class="classname">org.apache.openjpa.jdbc.sql.SybaseDictionary</code></a> |
| class. |
| </p></li></ul></div><p> |
| The example below demonstrates how to set a dictionary and configure its |
| properties in your configuration file. The <code class="literal">DBDictionary</code> |
| property uses OpenJPA's <a href="ref_guide_conf_plugins.html" title="4. Plugin Configuration">plugin syntax |
| </a>. |
| </p><div class="example"><a name="ref_guide_dbsetup_dbdict"></a><p class="title"><b>Example 4.6. |
| Specifying a DBDictionary |
| </b></p><div class="example-contents"><pre class="programlisting"> |
| <property name="openjpa.jdbc.DBDictionary" value="hsql(SimulateLocking=true)"/> |
| </pre></div></div><br class="example-break"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ref_guide_dbsetup_dbdictprops"></a>4.1. |
| DBDictionary Properties |
| </h3></div></div></div><p> |
| The standard dictionaries all recognize the following properties. These |
| properties will usually not need to be overridden, since the dictionary |
| implementation should use the appropriate default values for your database. You |
| typically won't use these properties unless you are designing your own |
| <code class="classname">DBDictionary</code> for an unsupported database. |
| </p><div class="itemizedlist"><ul type="disc"><li><p><a name="DBDictionary.AllowsAliasInBulkClause"></a> |
| <a class="indexterm" name="d0e17975"></a> |
| <code class="literal">AllowsAliasInBulkClause</code>: |
| When true, SQL delete and update statements may use table aliases. |
| </p></li><li><p><a name="DBDictionary.ArrayTypeName"></a> |
| <a class="indexterm" name="d0e17987"></a> |
| <code class="literal">ArrayTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.ARRAY</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.AutoAssignClause"></a> |
| <a class="indexterm" name="d0e18005"></a> |
| <code class="literal">AutoAssignClause</code>: The column definition clause to append to |
| a creation statement. For example, <code class="literal">"AUTO_INCREMENT"</code> for |
| MySQL. This property is set automatically in the dictionary, and should not need |
| to be overridden, and is only used when the schema is generated using the |
| <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.AutoAssignTypeName"></a> |
| <a class="indexterm" name="d0e18025"></a> |
| <a class="indexterm" name="d0e18031"></a> |
| <code class="literal">AutoAssignTypeName</code>: |
| The column type name for auto-increment |
| columns. For example, <code class="literal">"BIGSERIAL"</code> for PostgreSQL. This |
| property is set automatically in the dictionary and should not need to be |
| overridden. It is used only when the schema is generated using the |
| <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.BatchLimit"></a> |
| <a class="indexterm" name="d0e18051"></a> |
| <code class="literal">BatchLimit</code>: |
| The default batch limit for sending multiple SQL statements at once to the |
| database. A value of -1 indicates unlimited batching, and any positive integer |
| indicates the maximum number of SQL statements to batch together. |
| Defaults to 0 which disables batching. |
| </p></li><li><p><a name="DBDictionary.BigintTypeName"></a> |
| <a class="indexterm" name="d0e18063"></a> |
| <code class="literal">BigintTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.BIGINT</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.BinaryTypeName"></a> |
| <a class="indexterm" name="d0e18081"></a> |
| <code class="literal">BinaryTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.BINARY</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.BitTypeName"></a> |
| <a class="indexterm" name="d0e18099"></a> |
| <code class="literal">BitTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.BIT</code>. This is used only when the schema is generated by |
| the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.BlobBufferSize"></a> |
| <a class="indexterm" name="d0e18117"></a> |
| <code class="literal">BlobBufferSize</code>: This property establishes the buffer size in |
| the <code class="literal">INSERT/UPDATE</code> operations with an |
| <code class="literal">java.io.InputStream</code>This is only used with OpenJPA's |
| <a href="ref_guide_mapping_jpa.html#ref_guide_streamsupport" title="7.11. Stream LOB Support">Section 7.11, “ |
| Stream LOB Support |
| ”</a>. Defaults to 50000. |
| </p></li><li><p><a name="DBDictionary.BlobTypeName"></a> |
| <a class="indexterm" name="d0e18137"></a> |
| <a class="indexterm" name="d0e18143"></a> |
| <code class="literal">BlobTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.BLOB</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.BooleanTypeName"></a> |
| <a class="indexterm" name="d0e18161"></a> |
| <code class="literal">BooleanTypeName</code>: |
| The overridden default column type for |
| <code class="literal">java.sql.Types.BOOLEAN</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.CastFunction"></a> |
| <a class="indexterm" name="d0e18179"></a> |
| <code class="literal">CastFunction</code>: |
| The SQL function call to cast a value to another SQL type. |
| Use the tokens <code class="literal">{0}</code> and <code class="literal">{1}</code> to represent |
| the two arguments. The result of the function is convert the |
| <code class="literal">{0}</code> value to a <code class="literal">{1}</code> type. |
| The default is <code class="literal">"CAST({0} AS {1})"</code>. |
| </p></li><li><p><a name="DBDictionary.CatalogSeparator"></a> |
| <a class="indexterm" name="d0e18206"></a> |
| <code class="literal">CatalogSeparator</code>: The string the database uses to delimit |
| between the schema name and the table name. This is typically <code class="literal">"." |
| </code>, which is the default. |
| </p></li><li><p><a name="DBDictionary.CharTypeName"></a> |
| <a class="indexterm" name="d0e18221"></a> |
| <code class="literal">CharTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.CHAR</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.CharacterColumnSize"></a> |
| <a class="indexterm" name="d0e18239"></a> |
| <code class="literal">CharacterColumnSize</code>: The default size of <code class="literal">varchar |
| </code> and <code class="literal">char</code> columns. Typically 255. |
| </p></li><li><p><a name="DBDictionary.ClobBufferSize"></a> |
| <a class="indexterm" name="d0e18257"></a> |
| <code class="literal">ClobBufferSize</code>: This property establish the buffer size in |
| the <code class="literal">INSERT/UPDATE</code> operations with a |
| <code class="literal">java.io.Reader</code>This is only used with OpenJPA's |
| <a href="ref_guide_mapping_jpa.html#ref_guide_streamsupport" title="7.11. Stream LOB Support">Section 7.11, “ |
| Stream LOB Support |
| ”</a>. Defaults to 50000. |
| </p></li><li><p><a name="DBDictionary.ClobTypeName"></a> |
| <a class="indexterm" name="d0e18277"></a> |
| <a class="indexterm" name="d0e18283"></a> |
| <code class="literal">ClobTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.CLOB</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.ClosePoolSQL"></a> |
| <a class="indexterm" name="d0e18301"></a> |
| <code class="literal">ClosePoolSQL</code>: |
| A special command to issue to the database when shutting down the pool. |
| Usually the pool of connections to the database is closed when the |
| application is ending. For embedded databases, whose lifecycle is |
| coterminous with the application, there may be a special |
| command, usually <code class="literal">"SHUTDOWN"</code>, |
| that will cause the embedded database to close cleanly. |
| Defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.ConcatenateFunction"></a> |
| <a class="indexterm" name="d0e18319"></a> |
| <code class="literal">ConcatenateFunction</code>: |
| The SQL function call or operation to concatenate two strings. |
| Use the tokens <code class="literal">{0}</code> and <code class="literal">{1}</code> to represent |
| the two arguments. The result of the function or operation is to concatenate |
| the <code class="literal">{1}</code> string to the end of the <code class="literal">{0}</code> |
| string. Defaults to <code class="literal">"({0}||{1})"</code>. |
| </p></li><li><p><a name="DBDictionary.ConstraintNameMode"></a> |
| <a class="indexterm" name="d0e18346"></a> |
| <code class="literal">ConstraintNameMode</code>: When creating constraints, whether to |
| put the constraint name before the definition (<code class="literal">"before"</code>), |
| just after the constraint type name (<code class="literal">"mid"</code>), or after the |
| constraint definition (<code class="literal">"after"</code>). |
| Defaults to <code class="literal">"before"</code>. |
| </p></li><li><p><a name="DBDictionary.CreatePrimaryKeys"></a> |
| <a class="indexterm" name="d0e18370"></a> |
| <code class="literal">CreatePrimaryKeys</code>: When false, do not |
| create database primary keys for identifiers. Defaults to <code class="literal">true |
| </code>. |
| </p></li><li><p><a name="DBDictionary.CrossJoinClause"></a> |
| <a class="indexterm" name="d0e18385"></a> |
| <code class="literal">CrossJoinClause</code>: The clause to use for a cross join |
| (cartesian product). Defaults to <code class="literal">"CROSS JOIN"</code>. |
| </p></li><li><p><a name="DBDictionary.CurrentDateFunction"></a> |
| <a class="indexterm" name="d0e18400"></a> |
| <code class="literal">CurrentDateFunction</code>: |
| The SQL function call to obtain the current date from the database. |
| Defaults to <code class="literal">"CURRENT_DATE"</code>. |
| </p></li><li><p><a name="DBDictionary.CurrentTimeFunction"></a> |
| <a class="indexterm" name="d0e18415"></a> |
| <code class="literal">CurrentTimeFunction</code>: |
| The SQL function call to obtain the current time from the database. |
| Defaults to <code class="literal">"CURRENT_TIME"</code>. |
| </p></li><li><p><a name="DBDictionary.CurrentTimestampFunction"></a> |
| <a class="indexterm" name="d0e18430"></a> |
| <code class="literal">CurrentTimestampFunction</code>: |
| The SQL function call to obtain the current timestamp from the database. |
| Defaults to <code class="literal">"CURRENT_TIMESTAMP"</code>. |
| </p></li><li><p><a name="DBDictionary.DatePrecision"></a> |
| <a class="indexterm" name="d0e18445"></a> |
| <code class="literal">DatePrecision</code>: |
| The database is able to store time values to this degree of precision, |
| which is expressed in nanoseconds. |
| This value is usually one million, meaning that the database is able |
| to store time values with a precision of one millisecond. Particular |
| databases may have more or less precision. |
| OpenJPA will round all time values to this degree of precision |
| before storing them in the database. |
| Defaults to 1000000. |
| </p></li><li><p><a name="DBDictionary.DateTypeName"></a> |
| <a class="indexterm" name="d0e18457"></a> |
| <code class="literal">DateTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.DATE</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.DecimalTypeName"></a> |
| <a class="indexterm" name="d0e18475"></a> |
| <code class="literal">DecimalTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.DECIMAL</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.DistinctCountColumnSeparator"></a> |
| <a class="indexterm" name="d0e18493"></a> |
| <code class="literal">DistinctCountColumnSeparator</code>: The string the database uses |
| to delimit between column expressions in a <code class="literal">SELECT COUNT(DISTINCT |
| column-list)</code> clause. Defaults to <code class="literal">null</code> |
| for most databases, meaning that |
| multiple columns in a distinct COUNT clause are not supported. |
| </p></li><li><p><a name="DBDictionary.DistinctTypeName"></a> |
| <a class="indexterm" name="d0e18511"></a> |
| <code class="literal">DistinctTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.DISTINCT</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.DoubleTypeName"></a> |
| <a class="indexterm" name="d0e18529"></a> |
| <code class="literal">DoubleTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.DOUBLE</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.DriverVendor"></a> |
| <a class="indexterm" name="d0e18547"></a> |
| <code class="literal">DriverVendor</code>: The vendor of the particular JDBC driver you |
| are using. Some dictionaries must alter their behavior depending on the driver |
| vendor. Dictionaries usually detect the driver vendor and set this property |
| themselves. See the <code class="literal">VENDOR_XXX</code> constants defined in the |
| <code class="classname">DBDictionary</code> Javadoc for available options. |
| </p></li><li><p><a name="DBDictionary.DropTableSQL"></a> |
| <a class="indexterm" name="d0e18565"></a> |
| <code class="literal">DropTableSQL</code>: |
| The SQL statement used to drop a table. Use the token <code class="literal">{0}</code> |
| as the argument for the table name. |
| Defaults to <code class="literal">"DROP TABLE {0}"</code>. |
| </p></li><li><p><a name="DBDictionary.FixedSizeTypeNames"></a> |
| <a class="indexterm" name="d0e18583"></a> |
| <code class="literal">FixedSizeTypeNames</code>: |
| A comma separated list of additional database types that have a size |
| defined by the database. In other words, when a column of a fixed |
| size type is declared, its size cannot be defined by the user. Common |
| examples would be <code class="literal">DATE</code>, <code class="literal">FLOAT</code>, |
| and <code class="literal">INTEGER</code>. |
| Each database dictionary has its own internal set of fixed size type names |
| that include the names mentioned here and many others. |
| Names added to this property are added to the dictionary's internal set. |
| Defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.FloatTypeName"></a> |
| <a class="indexterm" name="d0e18607"></a> |
| <code class="literal">FloatTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.FLOAT</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.ForUpdateClause"></a> |
| <a class="indexterm" name="d0e18625"></a> |
| <a class="indexterm" name="d0e18631"></a> |
| <code class="literal">ForUpdateClause</code>: The clause to append to <code class="literal">SELECT |
| </code> statements to issue queries that obtain pessimistic locks. Defaults |
| to <code class="literal">"FOR UPDATE"</code>. |
| </p></li><li><p><a name="DBDictionary.GetStringVal"></a> |
| <a class="indexterm" name="d0e18649"></a> |
| <a class="indexterm" name="d0e18655"></a> |
| <code class="literal">GetStringVal</code>: |
| A special function to return the value of an XML |
| column in a select statement. For example, Oracle uses |
| <code class="literal">".getStringVal()"</code>, as in, |
| <code class="literal">"select t0.xmlcol.getStringVal() from xmltab t0"</code>. |
| Defaults to the empty string. |
| </p></li><li><p><a name="DBDictionary.InClauseLimit"></a> |
| <a class="indexterm" name="d0e18673"></a> |
| <a class="indexterm" name="d0e18679"></a> |
| <code class="literal">InClauseLimit</code>: |
| The maximum number of elements in an <code class="literal">IN</code> clause. OpenJPA |
| works around cases where the limit is exceeded. Defaults to -1 meaning |
| no limit. |
| </p></li><li><p><a name="DBDictionary.InitializationSQL"></a> |
| <a class="indexterm" name="d0e18694"></a> |
| <a class="indexterm" name="d0e18700"></a> |
| <code class="literal">InitializationSQL</code>: A piece of SQL to issue against the |
| database whenever a connection is retrieved from the <code class="classname">DataSource |
| </code>. |
| </p></li><li><p><a name="DBDictionary.InnerJoinClause"></a> |
| <a class="indexterm" name="d0e18715"></a> |
| <code class="literal">InnerJoinClause</code>: The clause to use for an inner join. |
| Defaults to <code class="literal">"INNER JOIN"</code>. |
| </p></li><li><p><a name="DBDictionary.IntegerTypeName"></a> |
| <a class="indexterm" name="d0e18730"></a> |
| <code class="literal">IntegerTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.INTEGER</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.JavaObjectTypeName"></a> |
| <a class="indexterm" name="d0e18748"></a> |
| <code class="literal">JavaObjectTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.JAVAOBJECT</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.JoinSyntax"></a> |
| <a class="indexterm" name="d0e18766"></a> |
| <code class="literal">JoinSyntax</code>: The SQL join syntax to use in select statements. |
| See <a href="ref_guide_dbsetup_sql92.html" title="6. Setting the SQL Join Syntax">Section 6, “ |
| Setting the SQL Join Syntax |
| ”</a>. |
| </p></li><li><p><a name="DBDictionary.LastGeneratedKeyQuery"></a> |
| <a class="indexterm" name="d0e18780"></a> |
| <code class="literal">LastGeneratedKeyQuery</code>: The query to issue to obtain the last |
| automatically generated key for an auto-increment column. For example, |
| <code class="literal">"SELECT LAST_INSERT_ID()"</code> for MySQL. This property is set |
| automatically in the dictionary, and should not need to be overridden. |
| </p></li><li><p><a name="DBDictionary.LongVarbinaryTypeName"></a> |
| <a class="indexterm" name="d0e18797"></a> |
| <code class="literal">LongVarbinaryTypeName</code>: The overridden default column type |
| for <code class="literal">java.sql.Types.LONGVARBINARY</code>. This is used only when the |
| schema is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.LongVarcharTypeName"></a> |
| <a class="indexterm" name="d0e18815"></a> |
| <code class="literal">LongVarcharTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.LONGVARCHAR</code>. This is used only when the |
| schema is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.MaxAutoAssignNameLength"></a> |
| <a class="indexterm" name="d0e18833"></a> |
| <code class="literal">MaxAutoAssignNameLength</code>: Set this property to the maximum |
| length of the sequence name used for auto-increment columns. Names longer than |
| this value are truncated. Defaults to 31. |
| </p></li><li><p><a name="DBDictionary.MaxColumnNameLength"></a> |
| <a class="indexterm" name="d0e18845"></a> |
| <code class="literal">MaxColumnNameLength</code>: The maximum number of characters in a |
| column name. Defaults to 128. |
| </p></li><li><p><a name="DBDictionary.MaxConstraintNameLength"></a> |
| <a class="indexterm" name="d0e18857"></a> |
| <code class="literal">MaxConstraintNameLength</code>: The maximum number of characters in |
| a constraint name. Defaults to 128. |
| </p></li><li><p><a name="DBDictionary.MaxEmbeddedBlobSize"></a> |
| <a class="indexterm" name="d0e18869"></a> |
| <code class="literal">MaxEmbeddedBlobSize</code>: |
| When greater than -1, the maximum size of a <code class="literal">BLOB</code> value |
| that can be sent directly to the database within an insert or update statement. |
| Values whose size is greater than <code class="literal">MaxEmbeddedBlobSize</code> force |
| OpenJPA to work around this limitation. A value of -1 means that there is |
| no limitation. Defaults to -1. |
| </p></li><li><p><a name="DBDictionary.MaxEmbeddedClobSize"></a> |
| <a class="indexterm" name="d0e18887"></a> |
| <code class="literal">MaxEmbeddedClobSize</code>: |
| When greater than -1, the maximum size of a <code class="literal">CLOB</code> value |
| that can be sent directly to the database within an insert or update statement. |
| Values whose size is greater than <code class="literal">MaxEmbeddedClobSize</code> force |
| OpenJPA to work around this limitation. A value of -1 means that there is |
| no limitation. Defaults to -1. |
| </p></li><li><p><a name="DBDictionary.MaxIndexNameLength"></a> |
| <a class="indexterm" name="d0e18905"></a> |
| <a class="indexterm" name="d0e18911"></a> |
| <code class="literal">MaxIndexNameLength</code>: The maximum number of characters in an |
| index name. Defaults to 128. |
| </p></li><li><p><a name="DBDictionary.MaxIndexesPerTable"></a> |
| <a class="indexterm" name="d0e18923"></a> |
| <code class="literal">MaxIndexesPerTable</code>: The maximum number of indexes that can |
| be placed on a single table. Defaults to no limit. |
| </p></li><li><p><a name="DBDictionary.MaxTableNameLength"></a> |
| <a class="indexterm" name="d0e18935"></a> |
| <code class="literal">MaxTableNameLength</code>: The maximum number of characters in a |
| table name. Defaults to 128. |
| </p></li><li><p><a name="DBDictionary.NextSequenceQuery"></a> |
| <a class="indexterm" name="d0e18947"></a> |
| <code class="literal">NextSequenceQuery</code>: A SQL string for obtaining a native |
| sequence value. May use a placeholder of <code class="literal">{0}</code> for the variable |
| sequence name and <code class="literal">{1}</code> for sequence increment. |
| Defaults to a database-appropriate value. For example, |
| <code class="literal">"SELECT {0}.NEXTVAL FROM DUAL"</code> for Oracle database. |
| </p></li><li><p><a name="DBDictionary.NullTypeName"></a> |
| <a class="indexterm" name="d0e18968"></a> |
| <code class="literal">NullTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.NULL</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.NumericTypeName"></a> |
| <a class="indexterm" name="d0e18986"></a> |
| <code class="literal">NumericTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.NUMERIC</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.OtherTypeName"></a> |
| <a class="indexterm" name="d0e19004"></a> |
| <code class="literal">OtherTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.OTHER</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.OuterJoinClause"></a> |
| <a class="indexterm" name="d0e19022"></a> |
| <code class="literal">OuterJoinClause</code>: The clause to use for an left outer join. |
| Defaults to <code class="literal">"LEFT OUTER JOIN"</code>. |
| </p></li><li><p><a name="DBDictionary.Platform"></a> |
| <a class="indexterm" name="d0e19037"></a> |
| <code class="literal">Platform</code>: |
| The name of the database that this dictionary targets. |
| Defaults to <code class="literal">"Generic"</code>, but all dictionaries override this |
| value. |
| </p></li><li><p><a name="DBDictionary.RangePosition"></a> |
| <a class="indexterm" name="d0e19052"></a> |
| <code class="literal">RangePosition</code>: |
| Indicates where to specify in the SQL select statement the range, if any, |
| of the result rows to be returned. |
| When limiting the number of returned result rows to a subset of all those |
| that satisfy the query's conditions, the position of the range clause |
| varies by database. |
| Defaults to 0, meaning that the range |
| is expressed at the end of the select statement but before any locking clause. |
| See the RANGE_XXX constants defined in <code class="classname">DBDictionary</code>. |
| </p></li><li><p><a name="DBDictionary.RealTypeName"></a> |
| <a class="indexterm" name="d0e19067"></a> |
| <code class="literal">RealTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.REAL</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.RefTypeName"></a> |
| <a class="indexterm" name="d0e19085"></a> |
| <code class="literal">RefTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.REF</code>. This is used only when the schema is generated by |
| the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.RequiresAliasForSubselect"></a> |
| <a class="indexterm" name="d0e19103"></a> |
| <a class="indexterm" name="d0e19109"></a> |
| <code class="literal">RequiresAliasForSubselect</code>: When true, the database |
| requires that subselects in a FROM clause be assigned an alias. |
| </p></li><li><p><a name="DBDictionary.RequiresAutoCommitForMetadata"></a> |
| <a class="indexterm" name="d0e19123"></a> |
| <code class="literal">RequiresAutoCommitForMetadata</code>: When true, the JDBC driver |
| requires that autocommit be enabled before any schema interrogation operations |
| can take place. |
| </p></li><li><p><a name="DBDictionary.RequiresCastForComparisons"></a> |
| <a class="indexterm" name="d0e19137"></a> |
| <code class="literal">RequiresCastForComparisons</code>: |
| When true, comparisons of two values of different types or |
| of two literals requires a cast in the generated SQL. |
| Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.RequiresCastForMathFunctions"></a> |
| <a class="indexterm" name="d0e19152"></a> |
| <code class="literal">RequiresCastForMathFunctions</code>: |
| When true, math operations on two values of different types or |
| on two literals requires a cast in the generated SQL. |
| Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.RequiresConditionForCrossJoin"></a> |
| <a class="indexterm" name="d0e19167"></a> |
| <code class="literal">RequiresConditionForCrossJoin</code>: Some databases require that |
| there always be a conditional statement for a cross join. If set, this parameter |
| ensures that there will always be some condition to the join clause. |
| </p></li><li><p><a name="DBDictionary.RequiresTargetForDelete"></a> |
| <a class="indexterm" name="d0e19179"></a> |
| <code class="literal">RequiresTargetForDelete</code>: |
| When true, the database requires a target for delete statements. Defaults |
| to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.ReservedWords"></a> |
| <a class="indexterm" name="d0e19194"></a> |
| <code class="literal">ReservedWords</code>: A comma-separated list of reserved words for |
| this database, beyond the standard SQL92 keywords. |
| </p></li><li><p><a name="DBDictionary.SchemaCase"></a> |
| <a class="indexterm" name="d0e19206"></a> |
| <code class="literal">SchemaCase</code>: The case to use when querying the database |
| metadata about schema components. Defaults to making all names upper case. |
| Available values are: <code class="literal">upper, lower, preserve</code>. |
| </p></li><li><p><a name="DBDictionary.SearchStringEscape"></a> |
| <a class="indexterm" name="d0e19223"></a> |
| <code class="literal">SearchStringEscape</code>: |
| The default escape character used when generating SQL <code class="literal">LIKE</code> |
| clauses. The escape character is used to escape the wildcard meaning of the |
| <code class="literal">_</code> and <code class="literal">%</code> characters. |
| Note: since JPQL provides the ability to define the escape character in |
| the query, this setting is primarily used when translating other query |
| languages, such as JDOQL. Defaults to <code class="literal">"\\"</code> |
| (a single backslash in Java speak). |
| </p></li><li><p><a name="DBDictionary.RequiresSearchStringEscapeForLike"></a> |
| <a class="indexterm" name="d0e19247"></a> |
| <code class="literal">RequiresSearchStringEscapeForLike</code>: |
| When true, the database requires an escape string for queries that use |
| <code class="literal">LIKE</code>. The escape string can be specified using |
| <code class="literal">searchStringEscape</code>. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SelectWords"></a> |
| <a class="indexterm" name="d0e19268"></a> |
| <code class="literal">SelectWords</code>: A comma-separated list of keywords which may be |
| used to start a SELECT statement for this database. If an application executes |
| a native SQL statement which begins with SelectWords OpenJPA will treat the |
| statement as a SELECT statement rather than an UPDATE statement. |
| </p></li><li><p><a name="DBDictionary.SequenceNameSQL"></a> |
| <a class="indexterm" name="d0e19280"></a> |
| <code class="literal">SequenceNameSQL</code>: |
| Additional phrasing to use with <code class="literal">SequenceSQL</code>. |
| Defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.SequenceSQL"></a> |
| <a class="indexterm" name="d0e19300"></a> |
| <code class="literal">SequenceSQL</code>: |
| General structure of the SQL query to use when interrogating the database |
| for sequence names. |
| As there is no standard way to obtain sequence names, |
| it defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.SequenceSchemaSQL"></a> |
| <a class="indexterm" name="d0e19317"></a> |
| <code class="literal">SequenceSchemaSQL</code>: |
| Additional phrasing to use with <code class="literal">SequenceSQL</code>. |
| Defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.SimulateLocking"></a> |
| <a class="indexterm" name="d0e19337"></a> |
| <code class="literal">SimulateLocking</code>: Some databases do not support pessimistic |
| locking, which will result in an exception when you attempt a |
| transaction while using the pessimistic lock manager. |
| Setting this property to <code class="literal">true</code> suppresses the |
| locking of rows in the database, thereby allowing pessimistic transactions |
| even on databases that do not support locking. At the same time, setting this |
| property to <code class="literal">true</code> means that you do not obtain the semantics |
| of a pessimistic |
| transaction with the database. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SmallintTypeName"></a> |
| <a class="indexterm" name="d0e19358"></a> |
| <code class="literal">SmallintTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.SMALLINT</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.StorageLimitationsFatal"></a> |
| <a class="indexterm" name="d0e19376"></a> |
| <code class="literal">StorageLimitationsFatal</code>: When true, any data |
| truncation/rounding that is performed by the dictionary in order to store a |
| value in the database will be treated as a fatal error, rather than just issuing |
| a warning. |
| </p></li><li><p><a name="DBDictionary.StoreCharsAsNumbers"></a> |
| <a class="indexterm" name="d0e19388"></a> |
| <code class="literal">StoreCharsAsNumbers</code>: Set this property to <code class="literal">false |
| </code> to store Java <code class="literal">char</code> fields as <code class="literal">CHAR |
| </code> values rather than numbers. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.StoreLargeNumbersAsStrings"></a> |
| <a class="indexterm" name="d0e19412"></a> |
| <code class="literal">StoreLargeNumbersAsStrings</code>: When true, the dictionary |
| prefers to store Java fields of |
| type <code class="classname">BigInteger</code> and <code class="classname">BigDecimal</code>) |
| as string values in the database. Likewise, the dictionary will instruct |
| the mapping tool to map these Java types to character columns. |
| Because some databases have limitations on the number of digits that can |
| be stored in a numeric column (for example, Oracle can only store 38 |
| digits), this option may be necessary for some applications. |
| Note that this option may prevent OpenJPA from executing meaningful numeric |
| queries against the columns. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.StringLengthFunction"></a> |
| <a class="indexterm" name="d0e19433"></a> |
| <code class="literal">StringLengthFunction</code>: Name of the SQL function for getting |
| the length of a string. Use the token <code class="literal">{0}</code> to represent the |
| argument. |
| </p></li><li><p><a name="DBDictionary.StructTypeName"></a> |
| <a class="indexterm" name="d0e19448"></a> |
| <code class="literal">StructTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.STRUCT</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.SubstringFunctionName"></a> |
| <a class="indexterm" name="d0e19466"></a> |
| <code class="literal">SubstringFunctionName</code>: Name of the SQL function for getting |
| the substring of a string. |
| </p></li><li><p><a name="DBDictionary.SupportsAlterTableWithAddColumn"></a> |
| <a class="indexterm" name="d0e19478"></a> |
| <code class="literal">SupportsAlterTableWithAddColumn</code>: When true, the database |
| supports adding a new column in an ALTER TABLE statement. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsAlterTableWithDropColumn"></a> |
| <a class="indexterm" name="d0e19493"></a> |
| <code class="literal">SupportsAlterTableWithDropColumn</code>: When true, the database |
| supports dropping a column in an ALTER TABLE statement. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsAutoAssign"></a> |
| <a class="indexterm" name="d0e19508"></a> |
| <code class="literal">SupportsAutoAssign</code>: |
| When true, the database supports auto-assign columns, where the value of |
| column is assigned upon insertion of the row into the database. |
| Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsCascadeDeleteAction"></a> |
| <a class="indexterm" name="d0e19523"></a> |
| <code class="literal">SupportsCascadeDeleteAction</code>: When true, the database supports |
| the <code class="literal">CASCADE</code> delete action on foreign keys. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsCascadeUpdateAction"></a> |
| <a class="indexterm" name="d0e19541"></a> |
| <code class="literal">SupportsCascadeUpdateAction</code>: |
| When true, the database supports the <code class="literal">CASCADE</code> |
| update action on foreign keys. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsComments"></a> |
| <a class="indexterm" name="d0e19559"></a> |
| <code class="literal">SupportsComments</code>: |
| When true, comments can be associated with the table in the table creation |
| statement. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsCorrelatedSubselect"></a> |
| <a class="indexterm" name="d0e19574"></a> |
| <code class="literal">SupportsCorrelatedSubselect</code>: |
| When true, the database supports correlated subselects. Correlated |
| subselects are select statements nested within select statements that |
| refers to a column in the outer select statement. For performance |
| reasons, correlated subselects are generally a last resort. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsDefaultDeleteAction"></a> |
| <a class="indexterm" name="d0e19589"></a> |
| <code class="literal">SupportsDefaultDeleteAction</code>: When true, the database supports |
| the <code class="literal">SET DEFAULT</code> delete action on foreign keys. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsDefaultUpdateAction"></a> |
| <a class="indexterm" name="d0e19607"></a> |
| <code class="literal">SupportsDefaultUpdateAction</code>: |
| When true, the database supports the <code class="literal">SET DEFAULT</code> update |
| action on foreign keys. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsDeferredConstraints"></a> |
| <a class="indexterm" name="d0e19625"></a> |
| <code class="literal">SupportsDeferredConstraints</code>: When true, the database |
| supports deferred constraints. The |
| database supports deferred constraints by checking for constraint |
| violations when the transaction commits, rather than checking for |
| violations immediately after receiving each SQL statement within the |
| transaction. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsForeignKeys"></a> |
| <a class="indexterm" name="d0e19640"></a> |
| <code class="literal">SupportsForeignKeys</code>: When true, the database supports foreign |
| keys. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsHaving"></a> |
| <a class="indexterm" name="d0e19655"></a> |
| <code class="literal">SupportsHaving</code>: When true, the database supports HAVING |
| clauses in selects. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithDistinctClause"></a> |
| <a class="indexterm" name="d0e19669"></a> |
| <code class="literal">SupportsLockingWithDistinctClause</code>: When true, the |
| database supports <code class="literal">FOR UPDATE</code> select clauses with |
| <code class="literal">DISTINCT</code> clauses. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithInnerJoin"></a> |
| <a class="indexterm" name="d0e19687"></a> |
| <code class="literal">SupportsLockingWithInnerJoin</code>: When true, the database |
| supports <code class="literal">FOR UPDATE</code> select clauses with inner join queries. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithMultipleTables"></a> |
| <a class="indexterm" name="d0e19702"></a> |
| <code class="literal">SupportsLockingWithMultipleTables</code>: When true, the |
| database supports <code class="literal">FOR UPDATE</code> select clauses that select from |
| multiple tables. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithOrderClause"></a> |
| <a class="indexterm" name="d0e19717"></a> |
| <code class="literal">SupportsLockingWithOrderClause</code>: When true, the database |
| supports <code class="literal">FOR UPDATE</code> select clauses with <code class="literal">ORDER BY |
| </code> clauses. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithOuterJoin"></a> |
| <a class="indexterm" name="d0e19735"></a> |
| <code class="literal">SupportsLockingWithOuterJoin</code>: When true, the database |
| supports <code class="literal">FOR UPDATE</code> select clauses with outer join queries. |
| </p></li><li><p><a name="DBDictionary.SupportsLockingWithSelectRange"></a> |
| <a class="indexterm" name="d0e19750"></a> |
| <code class="literal">SupportsLockingWithSelectRange</code>: When true, the database |
| supports <code class="literal">FOR UPDATE</code> select clauses with queries that select a |
| range of data using <code class="literal">LIMIT</code>, <code class="literal">TOP</code> or the |
| database equivalent. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsModOperator"></a> |
| <a class="indexterm" name="d0e19774"></a> |
| <code class="literal">SupportsModOperator</code>: |
| When true, the database supports the modulus operator (<code class="literal">%</code>) |
| instead of the <code class="literal">MOD</code> function. |
| Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsMultipleNontransactionalResultSets"></a> |
| <code class="literal">SupportsMultipleNontransactionalResultSets</code>: When true, a |
| nontransactional connection is capable of having multiple open |
| <code class="classname">ResultSet</code> instances. |
| </p></li><li><p><a name="DBDictionary.SupportsNullDeleteAction"></a> |
| <a class="indexterm" name="d0e19804"></a> |
| <code class="literal">SupportsNullDeleteAction</code>: When true, the database supports |
| the <code class="literal">SET NULL</code> delete action on foreign keys. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsNullTableForGetColumns"></a> |
| <a class="indexterm" name="d0e19822"></a> |
| <code class="literal">SupportsNullTableForGetColumns</code>: When true, the database |
| supports passing a <code class="literal">null</code> parameter to <code class="methodname"> |
| DatabaseMetaData.getColumns</code> as an optimization to get information |
| about all the tables. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsNullTableForGetImportedKeys"></a> |
| <a class="indexterm" name="d0e19845"></a> |
| <code class="literal">SupportsNullTableForGetImportedKeys</code>: When true, the |
| database supports passing a <code class="literal">null</code> parameter to <code class="methodname"> |
| DatabaseMetaData.getImportedKeys</code> as an optimization to get |
| information about all the tables. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsNullTableForGetIndexInfo"></a> |
| <a class="indexterm" name="d0e19868"></a> |
| <code class="literal">SupportsNullTableForGetIndexInfo</code>: When true, the database |
| supports passing a <code class="literal">null</code> parameter to <code class="methodname"> |
| DatabaseMetaData.getIndexInfo</code> as an optimization to get information |
| about all the tables. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsNullTableForGetPrimaryKeys"></a> |
| <a class="indexterm" name="d0e19891"></a> |
| <code class="literal">SupportsNullTableForGetPrimaryKeys</code>: When true, the |
| database supports passing a <code class="literal">null</code> parameter to <code class="methodname"> |
| DatabaseMetaData.getPrimaryKeys</code> as an optimization to get |
| information about all the tables. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsNullUpdateAction"></a> |
| <a class="indexterm" name="d0e19914"></a> |
| <code class="literal">SupportsNullUpdateAction</code>: |
| When true, the database supports the <code class="literal">SET NULL</code> update |
| action on foreign keys. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsQueryTimeout"></a> |
| <a class="indexterm" name="d0e19932"></a> |
| <code class="literal">SupportsQueryTimeout</code>: When true, the JDBC driver supports |
| calls to <code class="methodname"> java.sql.Statement.setQueryTimeout</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsRestrictDeleteAction"></a> |
| <a class="indexterm" name="d0e19949"></a> |
| <code class="literal">SupportsRestrictDeleteAction</code>: When true, the database |
| supports the <code class="literal">RESTRICT</code> delete action on foreign keys. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsRestrictUpdateAction"></a> |
| <a class="indexterm" name="d0e19967"></a> |
| <code class="literal">SupportsRestrictUpdateAction</code>: |
| When true, the database supports the <code class="literal">RESTRICT</code> update |
| action on foreign keys. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsSchemaForGetColumns"></a> |
| <a class="indexterm" name="d0e19985"></a> |
| <code class="literal">SupportsSchemaForGetColumns</code>: When false, the database |
| driver does not support using the schema name for schema reflection on column |
| names. |
| </p></li><li><p><a name="DBDictionary.SupportsSchemaForGetTables"></a> |
| <a class="indexterm" name="d0e19999"></a> |
| <code class="literal">SupportsSchemaForGetTables</code>: If false, then the database |
| driver does not support using the schema name for schema reflection on table |
| names. |
| </p></li><li><p><a name="DBDictionary.SupportsSelectEndIndex"></a> |
| <a class="indexterm" name="d0e20013"></a> |
| <code class="literal">SupportsSelectEndIndex</code>: When true, the database can create a |
| select that is limited to the first N results. |
| </p></li><li><p><a name="DBDictionary.SupportsSelectForUpdate"></a> |
| <a class="indexterm" name="d0e20027"></a> |
| <code class="literal">SupportsSelectForUpdate</code>: When true, the database supports |
| <code class="literal">SELECT</code> statements with a pessimistic locking |
| (<code class="literal">FOR UPDATE</code>) clause. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsSelectStartIndex"></a> |
| <a class="indexterm" name="d0e20048"></a> |
| <code class="literal">SupportsSelectStartIndex</code>: When true, the database can create a |
| select that skips the first N results. |
| </p></li><li><p><a name="DBDictionary.SupportsSubselect"></a> |
| <a class="indexterm" name="d0e20062"></a> |
| <a class="indexterm" name="d0e20068"></a> |
| <code class="literal">SupportsSubselect</code>: When true, the database supports subselects |
| in queries. |
| </p></li><li><p><a name="DBDictionary.SupportsTimestampNanos"></a> |
| <a class="indexterm" name="d0e20082"></a> |
| <code class="literal">SupportsTimestampNanos</code>: When true, the database supports |
| nanoseconds with TIMESTAMP columns. |
| Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsUniqueConstraints"></a> |
| <a class="indexterm" name="d0e20095"></a> |
| <code class="literal">SupportsUniqueConstraints</code>: When true, the database supports |
| unique constraints. Defaults to <code class="literal">true</code>. |
| </p></li><li><p><a name="DBDictionary.SupportsXMLColumn"></a> |
| <a class="indexterm" name="d0e20110"></a> |
| <code class="literal">SupportsXMLColumn</code>: |
| When true, the database supports an XML column type. See |
| <a href="ref_guide_mapping_jpa.html#ref_guide_xmlmapping" title="7.10. XML Column Mapping">Section 7.10, “ |
| XML Column Mapping |
| ”</a> |
| for information on using this capability. Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="DBDictionary.SystemSchemas"></a> |
| <a class="indexterm" name="d0e20127"></a> |
| <code class="literal">SystemSchemas</code>: A comma-separated list of schema names that |
| should be ignored. |
| </p></li><li><p><a name="DBDictionary.SystemTables"></a> |
| <a class="indexterm" name="d0e20141"></a> |
| <code class="literal">SystemTables</code>: A comma-separated list of table names that |
| should be ignored. |
| </p></li><li><p><a name="DBDictionary.TableForUpdateClause"></a> |
| <a class="indexterm" name="d0e20155"></a> |
| <a class="indexterm" name="d0e20161"></a> |
| <code class="literal">TableForUpdateClause</code>: The clause to append to the end of |
| each table alias in queries that obtain pessimistic locks. |
| Defaults to <code class="literal">null</code>. |
| </p></li><li><p><a name="DBDictionary.TableTypes"></a> |
| <a class="indexterm" name="d0e20176"></a> |
| <code class="literal">TableTypes</code>: Comma-separated list of table types to use when |
| looking for tables during schema reflection, as defined in the <code class="methodname"> |
| java.sql.DatabaseMetaData.getTableInfo</code> JDBC method. An example is: |
| <code class="literal">"TABLE,VIEW,ALIAS"</code>. Defaults to <code class="literal">"TABLE"</code>. |
| </p></li><li><p><a name="DBDictionary.TimeTypeName"></a> |
| <a class="indexterm" name="d0e20199"></a> |
| <code class="literal">TimeTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.TIME</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.TimestampTypeName"></a> |
| <a class="indexterm" name="d0e20217"></a> |
| <code class="literal">TimestampTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.TIMESTAMP</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.TinyintTypeName"></a> |
| <a class="indexterm" name="d0e20235"></a> |
| <code class="literal">TinyintTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.TINYINT</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.ToLowerCaseFunction"></a> |
| <a class="indexterm" name="d0e20253"></a> |
| <code class="literal">ToLowerCaseFunction</code>: Name of the SQL function for converting |
| a string to lower case. Use the token <code class="literal">{0}</code> to represent the |
| argument. |
| </p></li><li><p><a name="DBDictionary.ToUpperCaseFunction"></a> |
| <a class="indexterm" name="d0e20268"></a> |
| <code class="literal">ToUpperCaseFunction</code>: SQL function call for for converting a |
| string to upper case. Use the token <code class="literal">{0}</code> to represent the |
| argument. |
| </p></li><li><p><a name="DBDictionary.TrimBothFunction"></a> |
| <a class="indexterm" name="d0e20283"></a> |
| <code class="literal">TrimBothFunction</code>: |
| The SQL function call to trim any number of a particular character |
| from both the start and end of a string. |
| Note: some databases do not support specifying the character in which |
| case only spaces or whitespace can be trimmed. |
| Use the token <code class="literal">{1}</code> when possible to represent the character, |
| and the token <code class="literal">{0}</code> to represent the string. |
| Defaults to <code class="literal">"TRIM(BOTH {1} FROM {0})"</code>. |
| </p></li><li><p><a name="DBDictionary.TrimLeadingFunction"></a> |
| <a class="indexterm" name="d0e20304"></a> |
| <code class="literal">TrimLeadingFunction</code>: |
| The SQL function call to trim any number of a particular character |
| from the start of a string. |
| Note: some databases do not support specifying the character in which |
| case only spaces or whitespace can be trimmed. |
| Use the token <code class="literal">{1}</code> when possible to represent the character, |
| and the token <code class="literal">{0}</code> to represent the string. |
| Defaults to <code class="literal">"TRIM(LEADING {1} FROM {0})"</code>. |
| </p></li><li><p><a name="DBDictionary.TrimTrailingFunction"></a> |
| <a class="indexterm" name="d0e20325"></a> |
| <code class="literal">TrimTrailingFunction</code>: |
| The SQL function call to trim any number of a particular character |
| from the end of a string. |
| Note: some databases do not support specifying the character in which |
| case only spaces or whitespace can be trimmed. |
| Use the token <code class="literal">{1}</code> when possible to represent the character, |
| and the token <code class="literal">{0}</code> to represent the string. |
| Defaults to <code class="literal">"TRIM(TRAILING {1} FROM {0})"</code>. |
| </p></li><li><p><a name="DBDictionary.UseGetBestRowIdentifierForPrimaryKeys"></a> |
| <a class="indexterm" name="d0e20346"></a> |
| <code class="literal">UseGetBestRowIdentifierForPrimaryKeys</code>: When true, |
| metadata queries will use <code class="methodname">DatabaseMetaData.getBestRowIdentifier |
| </code> to obtain information about primary keys, rather than <code class="methodname"> |
| DatabaseMetaData.getPrimaryKeys</code>. |
| </p></li><li><p><a name="DBDictionary.UseGetBytesForBlobs"></a> |
| <a class="indexterm" name="d0e20366"></a> |
| <code class="literal">UseGetBytesForBlobs</code>: When true, <code class="methodname"> |
| ResultSet.getBytes</code> will be used to obtain blob data rather than |
| <code class="methodname">ResultSet.getBinaryStream</code>. |
| </p></li><li><p><a name="DBDictionary.UseGetObjectForBlobs"></a> |
| <a class="indexterm" name="d0e20384"></a> |
| <code class="literal">UseGetObjectForBlobs</code>: When true, <code class="methodname"> |
| ResultSet.getObject</code> will be used to obtain blob data rather than |
| <code class="methodname">ResultSet.getBinaryStream</code>. |
| </p></li><li><p><a name="DBDictionary.UseGetStringForClobs"></a> |
| <a class="indexterm" name="d0e20402"></a> |
| <code class="literal">UseGetStringForClobs</code>: When true, <code class="methodname"> |
| ResultSet.getString</code> will be used to obtain clob data rather than |
| <code class="methodname">ResultSet.getCharacterStream</code>. |
| </p></li><li><p><a name="DBDictionary.UseJDBC4SetBinaryStream"></a> |
| <a class="indexterm" name="d0e20420"></a> |
| <code class="literal">UseJDBC4SetBinaryStream</code>: When true, an attempt will be made to obtain |
| a JDBC 4.0 version of <code class="methodname">PreparedStatement.setBinaryStream</code>. |
| By default a <code class="methodname">setBinaryStream</code> is used which takes the length of the |
| stream. OpenJPA uses a -1 for the length since OpenJPA doesn't know the length of the stream. |
| A few JDBC drivers check the length and throw an exception when the length is less than zero. |
| When this property is set to true, and an applicable JDK and JDBC 4.0 driver is available, a |
| version of <code class="methodname">setBinaryStream</code> will be used which does not take a length. |
| The default value of this property is false. |
| </p></li><li><p><a name="DBDictionary.UseNativeSequenceCache"></a> |
| <a class="indexterm" name="d0e20441"></a> |
| <code class="literal">UseNativeSequenceCache</code>: This property is used |
| to indicate (when set to false) that OpenJPA should not use the |
| CACHE clause when getting a native sequence; instead |
| the INCREMENT BY clause gets its value equal to the allocationSize |
| property. |
| </p></li><li><p><a name="DBDictionary.UseSchemaName"></a> |
| <a class="indexterm" name="d0e20453"></a> |
| <code class="literal">UseSchemaName</code>: If <code class="literal">false</code>, then avoid |
| including the schema name in table name references. Defaults to <code class="literal">true |
| </code>. |
| </p></li><li><p><a name="DBDictionary.UseSetBytesForBlobs"></a> |
| <a class="indexterm" name="d0e20471"></a> |
| <code class="literal">UseSetBytesForBlobs</code>: When true, <code class="methodname"> |
| PreparedStatement.setBytes</code> will be used to set blob data, rather |
| than <code class="methodname">PreparedStatement.setBinaryStream</code>. |
| </p></li><li><p><a name="DBDictionary.UseSetStringForClobs"></a> |
| <a class="indexterm" name="d0e20489"></a> |
| <code class="literal">UseSetStringForClobs</code>: When true, <code class="methodname"> |
| PreparedStatement.setString</code> will be used to set clob data, rather |
| than <code class="methodname">PreparedStatement.setCharacterStream</code>. |
| </p></li><li><p><a name="DBDictionary.ValidationSQL"></a> |
| <a class="indexterm" name="d0e20507"></a> |
| <a class="indexterm" name="d0e20513"></a> |
| <code class="literal">ValidationSQL</code>: The SQL used to validate that a connection is |
| still in a valid state. For example, <code class="literal">"SELECT SYSDATE FROM DUAL" |
| </code> for Oracle. |
| </p></li><li><p><a name="DBDictionary.VarbinaryTypeName"></a> |
| <a class="indexterm" name="d0e20528"></a> |
| <code class="literal">VarbinaryTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.VARBINARY</code>. This is used only when the schema |
| is generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.VarcharTypeName"></a> |
| <a class="indexterm" name="d0e20546"></a> |
| <code class="literal">VarcharTypeName</code>: The overridden default column type for |
| <code class="literal">java.sql.Types.VARCHAR</code>. This is used only when the schema is |
| generated by the <code class="literal">mappingtool</code>. |
| </p></li><li><p><a name="DBDictionary.XmlTypeName"></a> |
| <a class="indexterm" name="d0e20564"></a> |
| <code class="literal">XmlTypeName</code>: |
| The column type name for XML columns. This |
| property is set automatically in the dictionary and should not need to be |
| overridden. It is used only when the schema is generated using the |
| <code class="literal">mappingtool</code>. Defaults to <code class="literal">"XML"</code>. |
| </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ref_guide_dbsetup_dbsupport_mysql"></a>4.2. |
| MySQLDictionary Properties |
| </h3></div></div></div><a class="indexterm" name="d0e20583"></a><p> |
| The <code class="literal">mysql</code> dictionary also understands the following |
| properties: |
| </p><div class="itemizedlist"><ul type="disc"><li><p><a name="MySQLDictionary.DriverDeserializesBlobs"></a> |
| <a class="indexterm" name="d0e20597"></a> |
| <code class="literal">DriverDeserializesBlobs</code>: Many MySQL drivers automatically |
| deserialize BLOBs on calls to <code class="methodname">ResultSet.getObject</code>. The |
| <code class="classname">MySQLDictionary</code> overrides the standard <code class="methodname"> |
| DBDictionary.getBlobObject</code> method to take this into account. If |
| your driver does not deserialize automatically, set this property to |
| <code class="literal">false</code>. |
| </p></li><li><p><a name="MySQLDictionary.TableType"></a> |
| <a class="indexterm" name="d0e20621"></a> |
| <code class="literal">TableType</code>: The MySQL table type to use when creating tables. |
| Defaults to <code class="literal">"innodb"</code>. |
| </p></li><li><p><a name="MySQLDictionary.UseClobs"></a> |
| <a class="indexterm" name="d0e20636"></a> |
| <code class="literal">UseClobs</code>: Some older versions of MySQL do not handle clobs |
| correctly. To enable clob functionality, set this to <code class="literal">true</code>. |
| Defaults to <code class="literal">false</code>. |
| </p></li><li><p><a name="MySQLDictionary.OptimizeMultiTableDeletes"></a> |
| <a class="indexterm" name="d0e20654"></a> |
| <code class="literal">OptimizeMultiTableDeletes</code>: MySQL as of version 4.0.0 |
| supports multiple tables in <code class="literal">DELETE</code> statements. When |
| this option is set, OpenJPA will use that syntax when doing bulk deletes |
| from multiple tables. This can happen when the |
| <code class="literal">deleteTableContents</code> <code class="literal">SchemaTool</code> |
| action is used. (See <a href="ref_guide_schema_schematool.html" title="13. Schema Tool">Section 13, “ |
| Schema Tool |
| ”</a> for |
| more info about <code class="literal">deleteTableContents</code>.) Defaults to |
| <code class="literal">false</code>, since the statement may fail if using InnoDB |
| tables and delete constraints. |
| </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ref_guide_dbsetup_dbsupport_oracle"></a>4.3. |
| OracleDictionary Properties |
| </h3></div></div></div><a class="indexterm" name="d0e20683"></a><p> |
| The <code class="literal">oracle</code> dictionary understands the following additional |
| properties: |
| </p><div class="itemizedlist"><ul type="disc"><li><p><a name="OracleDictionary.UseTriggersForAutoAssign"></a> |
| <a class="indexterm" name="d0e20697"></a> |
| <a class="indexterm" name="d0e20703"></a> |
| <code class="literal">UseTriggersForAutoAssign</code>: When true, OpenJPA will allow |
| simulation of auto-increment columns by the use of Oracle triggers. OpenJPA will |
| assume that the current sequence value from the sequence specified in the |
| <code class="literal">AutoAssignSequenceName</code> parameter will hold the value of the |
| new primary key for rows that have been inserted. For more details on |
| auto-increment support, see <a href="ref_guide_pc_oid.html#ref_guide_pc_oid_pkgen_autoinc" title="4.4. Autoassign / Identity Strategy Caveats">Section 4.4, “ |
| Autoassign / Identity Strategy Caveats |
| ”</a> |
| . |
| </p></li><li><p><a name="OracleDictionary.AutoAssignSequenceName"></a> |
| <a class="indexterm" name="d0e20722"></a> |
| <a class="indexterm" name="d0e20728"></a> |
| <code class="literal">AutoAssignSequenceName</code>: The global name of the sequence that |
| OpenJPA will assume to hold the value of primary key value for rows that use |
| auto-increment. If left unset, OpenJPA will use a the sequence named <code class="literal"> |
| "SEQ_<table name>"</code>. |
| </p></li><li><p><a name="OracleDictionary.MaxEmbeddedBlobSize"></a> |
| <a class="indexterm" name="d0e20745"></a> |
| <a class="indexterm" name="d0e20751"></a> |
| <code class="literal">MaxEmbeddedBlobSize</code>: Oracle is unable to persist BLOBs using |
| the embedded update method when BLOBs get over a certain size. The size depends |
| on database configuration, e.g. encoding. This property defines the maximum size |
| BLOB to persist with the embedded method. Defaults to 4000 bytes. |
| </p></li><li><p><a name="OracleDictionary.MaxEmbeddedClobSize"></a> |
| <a class="indexterm" name="d0e20763"></a> |
| <a class="indexterm" name="d0e20769"></a> |
| <code class="literal">MaxEmbeddedClobSize</code>: Oracle is unable to persist CLOBs using |
| the embedded update method when Clobs get over a certain size. The size depends |
| on database configuration, e.g. encoding. This property defines the maximum size |
| CLOB to persist with the embedded method. Defaults to 4000 characters. |
| </p></li><li><p><a name="OracleDictionary.SupportsSetClob"></a> |
| <code class="literal">SupportsSetClob</code>: If true, OpenJPA will attempt to use a |
| Reader-based JDBC 4.0 method to set Clob or XML data. This allows XMLType |
| and Clob values larger than 4000 bytes to be used if OpenJPA is used |
| with a Java 6.0 JRE along with a JDBC 4.0 Oracle driver (e.g. ojdbc6.jar). |
| It is expected that this property will be used in conjunction with |
| <code class="literal">XMLValueHandler</code>, see <a href="ref_guide_mapping_jpa.html#ref_guide_xmlmapping" title="7.10. XML Column Mapping">Section 7.10, “ |
| XML Column Mapping |
| ”</a>. |
| That is, it is expected that the XML field in question will be annotated with |
| the <code class="literal">XMLValueHandler</code> annotation. This allows a user to |
| indicate that OpenJPA should use JAXB class metadata to perform the to/from |
| database value retrieval and storage. In addition, using this strategy |
| indicates there is an XMLType used to store the value in the database. However, |
| it is possible for a user to use the <code class="literal">SupportsSetClob</code> and |
| managing their own XML string, mapped to a string field. In this case, |
| additional actions need to be taken. First, the XML field will need to be |
| annotated with the <code class="literal">Lob</code> annotation. Second, the |
| <code class="literal">MaxEmbeddedClobSize</code> dictionary property will need to be |
| set to -1. Finally, a user may need to set the |
| <code class="literal">openjpa.jdbc.SchemaFactory</code> property to <code class="literal">native</code>, |
| see <a href="ref_guide_schema_info.html#ref_guide_schema_info_factory" title="12.2. Schema Factory">Section 12.2, “ |
| Schema Factory |
| ”</a>. |
| This property is necessary to allow OpenJPA to detect the XML column type. While |
| a user may have an XMLType specified in the column definition, OpenJPA cannot count |
| on this data to detect whether the column is really an XML column in the |
| database. (The table could have been created manually with separate DDL instead |
| of using OpenJPA's mapping tool). By enabling OpenJPA's native schema factory |
| the database column type can be detected as XMLType. |
| </p></li><li><p><a name="OracleDictionary.UseSetFormOfUseForUnicode"></a> |
| <code class="literal">UseSetFormOfUseForUnicode</code>: Prior to Oracle 10i, statements |
| executed against unicode capable columns (the <code class="literal">NCHAR</code>, |
| <code class="literal">NVARCHAR</code>, <code class="literal">NCLOB</code> Oracle types) required |
| special handling to be able to store unicode values. Setting this property to |
| <code class="literal">true</code> (the default) will cause OpenJPA to attempt to detect when the column of |
| one of these types, and if so, will attempt to correctly configure the statement |
| using the <code class="methodname"> OraclePreparedStatement.setFormOfUse</code>. For |
| more details, see the Oracle |
| <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/nchar/readme.html" target="_top"> |
| Readme For NChar</a>. Note that this can only work if OpenJPA is able to |
| access the underlying <code class="classname">OraclePreparedStatement</code> instance, |
| which may not be possible when using some third-party datasources. If OpenJPA |
| detects that this is the case, a warning will be logged. |
| </p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_dbsetup_sqlconn.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_dbsetup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_dbsetup_isolation.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. |
| Runtime Access to DataSource |
| </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 5. |
| Setting the Transaction Isolation |
| </td></tr></table></div></body></html> |