From 61a182f6fdc447f53bbf5fdf458415cd12037109 Mon Sep 17 00:00:00 2001 From: David Ezzio Date: Mon, 14 Jul 2008 13:54:52 +0000 Subject: [PATCH] Added database dictionary properties to address OpenJPA-654. git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.1.x@676592 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/doc/manual/ref_guide_dbsetup.xml | 768 ++++++++++++++++-- 1 file changed, 720 insertions(+), 48 deletions(-) diff --git a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml index ddb002ad5..f88e497e2 100644 --- a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml +++ b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml @@ -703,6 +703,20 @@ typically won't use these properties unless you are designing your own + + + + + SQL + + + AllowsAliasInBulkClause + + +AllowsAliasInBulkClause: +When true, SQL delete and update statements may use table aliases. + + @@ -714,7 +728,7 @@ typically won't use these properties unless you are designing your own ArrayTypeName: The overridden default column type for -java.sql.Types.ARRAY. This is only used when the schema is +java.sql.Types.ARRAY. This is used only when the schema is generated by the mappingtool. @@ -732,7 +746,7 @@ generated by the mappingtool. AutoAssignClause: The column definition clause to append to -a creation statement. For example, " AUTO_INCREMENT " for +a creation statement. For example, "AUTO_INCREMENT" 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 mappingtool. @@ -759,13 +773,31 @@ to be overridden, and is only used when the schema is generated using the AutoAssignTypeName -AutoAssignTypeName: The column type name for auto-increment -columns. For example, " BIGSERIAL " for PostgreSQL. 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 +AutoAssignTypeName: +The column type name for auto-increment +columns. For example, "BIGSERIAL" 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 mappingtool. + + + + + JDBC + + + BatchLimit + + +BatchLimit: +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. + + @@ -777,7 +809,7 @@ mappingtool. BigintTypeName: The overridden default column type for -java.sql.Types.BIGINT. This is only used when the schema is +java.sql.Types.BIGINT. This is used only when the schema is generated by the mappingtool. @@ -792,7 +824,7 @@ generated by the mappingtool. BinaryTypeName: The overridden default column type for -java.sql.Types.BINARY. This is only used when the schema is +java.sql.Types.BINARY. This is used only when the schema is generated by the mappingtool. @@ -807,7 +839,7 @@ generated by the mappingtool. BitTypeName: The overridden default column type for -java.sql.Types.BIT. This is only used when the schema is generated by +java.sql.Types.BIT. This is used only when the schema is generated by the mappingtool. @@ -846,10 +878,44 @@ the INSERT/UPDATE operations with an BlobTypeName: The overridden default column type for -java.sql.Types.BLOB. This is only used when the schema is +java.sql.Types.BLOB. This is used only when the schema is generated by the mappingtool. + + + + + DDL + + + BooleanTypeName + + +BooleanTypeName: +The overridden default column type for +java.sql.Types.BOOLEAN. This is used only when the schema +is generated by the mappingtool. + + + + + + + SQL + + + CastFunction + + +CastFunction: +The SQL function call to cast a value to another SQL type. +Use the tokens {0} and {1} to represent +the two arguments. The result of the function is convert the +{0} value to a {1} type. +The default is "CAST({0} AS {1})". + + @@ -876,7 +942,7 @@ between the schema name and the table name. This is typically "." CharTypeName: The overridden default column type for -java.sql.Types.CHAR. This is only used when the schema is +java.sql.Types.CHAR. This is used only when the schema is generated by the mappingtool. @@ -910,8 +976,6 @@ the INSERT/UPDATE operations with a . Defaults to 50000. - - @@ -931,10 +995,47 @@ the INSERT/UPDATE operations with a ClobTypeName: The overridden default column type for -java.sql.Types.CLOB. This is only used when the schema is +java.sql.Types.CLOB. This is used only when the schema is generated by the mappingtool. + + + + + JDBC + + + ClosePoolSQL + + +ClosePoolSQL: +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 "SHUTDOWN", +that will cause the embedded database to close cleanly. Defaults to null. + + + + + + + SQL + + + ConcatenateFunction + + +ConcatenateFunction: +The SQL function call or operation to concatenate two strings. +Use the tokens {0} and {1} to represent +the two arguments. The result of the function or operation is to concatenate +the {1} string to the end of the {0} +string. Defaults to "({0}||{1})". + + @@ -981,6 +1082,72 @@ create database primary keys for identifiers. Defaults to true (cartesian product). Defaults to CROSS JOIN. + + + + + SQL + + + CurrentDateFunction + + +CurrentDateFunction: +The SQL function call to obtain the current date from the database. +Defaults to "CURRENT_DATE". + + + + + + + SQL + + + CurrentTimeFunction + + +CurrentTimeFunction: +The SQL function call to obtain the current time from the database. +Defaults to "CURRENT_TIME". + + + + + + + SQL + + + CurrentTimestampFunction + + +CurrentTimestampFunction: +The SQL function call to obtain the current timestamp from the database. +Defaults to "CURRENT_TIMESTAMP". + + + + + + + JDBC + + + DatePrecision + + +DatePrecision: +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. + + @@ -992,7 +1159,7 @@ create database primary keys for identifiers. Defaults to true DateTypeName: The overridden default column type for -java.sql.Types.DATE. This is only used when the schema is +java.sql.Types.DATE. This is used only when the schema is generated by the mappingtool. @@ -1007,7 +1174,7 @@ generated by the mappingtool. DecimalTypeName: The overridden default column type for -java.sql.Types.DECIMAL. This is only used when the schema is +java.sql.Types.DECIMAL. This is used only when the schema is generated by the mappingtool. @@ -1038,7 +1205,7 @@ multiple columns in a distinct COUNT clause are not supported. DistinctTypeName: The overridden default column type for -java.sql.Types.DISTINCT. This is only used when the schema +java.sql.Types.DISTINCT. This is used only when the schema is generated by the mappingtool. @@ -1053,7 +1220,7 @@ is generated by the mappingtool. DoubleTypeName: The overridden default column type for -java.sql.Types.DOUBLE. This is only used when the schema is +java.sql.Types.DOUBLE. This is used only when the schema is generated by the mappingtool. @@ -1074,6 +1241,44 @@ themselves. See the VENDOR_XXX constants defined in the DBDictionary Javadoc for available options. + + + + + SQL + + + DropTableSQL + + +DropTableSQL: +The SQL statement used to drop a table. Use the token {0} +as the argument for the table name. +Defaults to "DROP TABLE {0}". + + + + + + + SQL + + + FixedSizeTypeNames + + +FixedSizeTypeNames: +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 DATE, FLOAT, +and INTEGER. +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 null. + + @@ -1085,7 +1290,7 @@ themselves. See the VENDOR_XXX constants defined in the FloatTypeName: The overridden default column type for -java.sql.Types.FLOAT. This is only used when the schema is +java.sql.Types.FLOAT. This is used only when the schema is generated by the mappingtool. @@ -1112,6 +1317,56 @@ generated by the mappingtool. to FOR UPDATE. + + + + + Oracle + + + GetStringVal + + + + + JDBC + + + GetStringVal + + +GetStringVal: +A special function to return the value of an XML +column in a select statement. For example, Oracle uses +".getStringVal()", as in, +"select t0.xmlcol.getStringVal() from xmltab t0". +Defaults to the empty string. + + + + + + + Oracle + + + InClauseLimit + + + + + JDBC + + + GetStringVal + + +InClauseLimit: +The maximum number of elements in an IN clause. OpenJPA +works around cases where the limit is exceeded. Defaults to -1 meaning +no limit. + + @@ -1160,7 +1415,7 @@ Defaults to INNER JOIN. IntegerTypeName: The overridden default column type for -java.sql.Types.INTEGER. This is only used when the schema is +java.sql.Types.INTEGER. This is used only when the schema is generated by the mappingtool. @@ -1175,7 +1430,7 @@ generated by the mappingtool. JavaObjectTypeName: The overridden default column type for -java.sql.Types.JAVAOBJECT. This is only used when the schema +java.sql.Types.JAVAOBJECT. This is used only when the schema is generated by the mappingtool. @@ -1207,8 +1462,8 @@ See . LastGeneratedKeyQuery: The query to issue to obtain the last -automatically generated key for an auto-increment column. For example, " -SELECT LAST_INSERT_ID() " for MySQL. This property is set +automatically generated key for an auto-increment column. For example, +"SELECT LAST_INSERT_ID()" for MySQL. This property is set automatically in the dictionary, and should not need to be overridden. @@ -1223,7 +1478,7 @@ automatically in the dictionary, and should not need to be overridden. LongVarbinaryTypeName: The overridden default column type -for java.sql.Types.LONGVARBINARY. This is only used when the +for java.sql.Types.LONGVARBINARY. This is used only when the schema is generated by the mappingtool. @@ -1238,7 +1493,7 @@ schema is generated by the mappingtool. LongVarcharTypeName: The overridden default column type for -java.sql.Types.LONGVARCHAR. This is only used when the +java.sql.Types.LONGVARCHAR. This is used only when the schema is generated by the mappingtool. @@ -1285,6 +1540,42 @@ column name. Defaults to 128. a constraint name. Defaults to 128. + + + + + SQL + + + MaxEmbeddedBlobSize + + +MaxEmbeddedBlobSize: +When greater than -1, the maximum size of a BLOB value +that can be sent directly to the database within an insert or update statement. +Values whose size is greater than MaxEmbeddedBlobSize force +OpenJPA to work around this limitation. A value of -1 means that there is +no limitation. Defaults to -1. + + + + + + + SQL + + + MaxEmbeddedClobSize + + +MaxEmbeddedClobSize: +When greater than -1, the maximum size of a CLOB value +that can be sent directly to the database within an insert or update statement. +Values whose size is greater than MaxEmbeddedClobSize force +OpenJPA to work around this limitation. A value of -1 means that there is +no limitation. Defaults to -1. + + @@ -1348,7 +1639,7 @@ table name. Defaults to 128. NextSequenceQuery: A SQL string for obtaining a native sequence value. May use a placeholder of {0} for the variable sequence name. Defaults to a database-appropriate value. For example, -" SELECT {0}.NEXTVAL FROM DUAL " for Oracle. +"SELECT {0}.NEXTVAL FROM DUAL" for Oracle. @@ -1362,7 +1653,7 @@ sequence name. Defaults to a database-appropriate value. For example, NullTypeName: The overridden default column type for -java.sql.Types.NULL. This is only used when the schema is +java.sql.Types.NULL. This is used only when the schema is generated by the mappingtool. @@ -1377,7 +1668,7 @@ generated by the mappingtool. NumericTypeName: The overridden default column type for -java.sql.Types.NUMERIC. This is only used when the schema is +java.sql.Types.NUMERIC. This is used only when the schema is generated by the mappingtool. @@ -1392,7 +1683,7 @@ generated by the mappingtool. OtherTypeName: The overridden default column type for -java.sql.Types.OTHER. This is only used when the schema is +java.sql.Types.OTHER. This is used only when the schema is generated by the mappingtool. @@ -1410,6 +1701,42 @@ generated by the mappingtool. Defaults to LEFT OUTER JOIN. + + + + + JDBC + + + Platform + + +Platform: +The name of the database that this dictionary targets. +Defaults to "Generic", but all dictionaries override this +value. + + + + + + + SQL + + + RangePosition + + +RangePosition: +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 (RANGE_POST_SELECT), meaning that the range +is expressed at the end of the select statement but before any locking clause. + + @@ -1421,7 +1748,7 @@ Defaults to LEFT OUTER JOIN. RealTypeName: The overridden default column type for -java.sql.Types.REAL. This is only used when the schema is +java.sql.Types.REAL. This is used only when the schema is generated by the mappingtool. @@ -1436,7 +1763,7 @@ generated by the mappingtool. RefTypeName: The overridden default column type for -java.sql.Types.REF. This is only used when the schema is generated by +java.sql.Types.REF. This is used only when the schema is generated by the mappingtool. @@ -1483,6 +1810,38 @@ requires that autocommit be enabled before any schema interrogation operations can take place. + + + + + SQL + + + RequiresCastForComparisons + + +RequiresCastForComparisons: +When true, comparisons of two values of different types or +of two literals requires a cast in the generated SQL. +Defaults to false. + + + + + + + SQL + + + RequiresCastForMathFunctions + + +RequiresCastForMathFunctions: +When true, math operations on two values of different types or +on two literals requires a cast in the generated SQL. +Defaults to false. + + @@ -1498,6 +1857,21 @@ 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. + + + + + SQL + + + RequiresTargetForDelete + + +RequiresTargetForDelete: +When true, the database requires a target for delete statements. Defaults +to false. + + @@ -1530,6 +1904,26 @@ metadata about schema components. Defaults to making all names upper case. Available values are: upper, lower, preserve. + + + + + SQL + + + SearchStringEscape + + +SearchStringEscape: +The default escape character used when generating SQL LIKE +clauses. The escape character is used to escape the wildcard meaning of the +_ and % 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 "\\" +(a single backslash in Java speak). + + @@ -1546,6 +1940,62 @@ a native SQL statement which begins with SelectWords OpenJPA will treat the statement as a SELECT statement rather than an UPDATE statement. + + + + + schema + + + reflection + + + SequenceNameSQL + + +SequenceNameSQL: +Additional phrasing to use with SequenceSQL. +Defaults to null. + + + + + + + schema + + + reflection + + + SequenceSQL + + +SequenceSQL: +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 null. + + + + + + + + schema + + + reflection + + + SequenceSchemaSQL + + +SequenceSchemaSQL: +Additional phrasing to use with SequenceSQL. +Defaults to null. + + @@ -1577,7 +2027,7 @@ transaction with the database. Defaults to false. SmallintTypeName: The overridden default column type for -java.sql.Types.SMALLINT. This is only used when the schema +java.sql.Types.SMALLINT. This is used only when the schema is generated by the mappingtool. @@ -1660,7 +2110,7 @@ argument. StructTypeName: The overridden default column type for -java.sql.Types.STRUCT. This is only used when the schema is +java.sql.Types.STRUCT. This is used only when the schema is generated by the mappingtool. @@ -1708,6 +2158,22 @@ supports dropping a column in an ALTER TABLE statement. Defaults to true. + + + + + SQL + + + SupportsAutoAssign + + +SupportsAutoAssign: +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 false. + + @@ -1718,8 +2184,57 @@ true. SupportsCascadeDeleteAction -SupportsCascadeDeleteAction: Whether the database supports -the CASCADE foreign key delete action. Defaults to true. +SupportsCascadeDeleteAction: When true, the database supports +the CASCADE delete action on foreign keys. +Defaults to true. + + + + + + + foreign keys + + + SupportsCascadeUpdateAction + + +SupportsCascadeUpdateAction: +When true, the database supports the CASCADE +update action on foreign keys. Defaults to true. + + + + + + + DDL + + + SupportsComments + + +SupportsComments: +When true, comments can be associated with the table in the table creation +statement. Defaults to false. + + + + + + + SQL + + + SupportsCorrelatedSubselect + + +SupportsCorrelatedSubselect: +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 true. @@ -1732,8 +2247,24 @@ the CASCADE foreign key delete action. Defaults to true. SupportsDefaultDeleteAction -SupportsDefaultDeleteAction: Whether the database supports -the SET DEFAULT foreign key delete action. Defaults to true. +SupportsDefaultDeleteAction: When true, the database supports +the SET DEFAULT delete action on foreign keys. +Defaults to true. + + + + + + + foreign keys + + + SupportsDefaultUpdateAction + + +SupportsDefaultUpdateAction: +When true, the database supports the SET DEFAULT update +action on foreign keys. Defaults to true. @@ -1874,6 +2405,21 @@ range of data using LIMIT, TOP or the database equivalent. Defaults to true. + + + + + SQL + + + SupportsModOperator + + +SupportsModOperator: +When true, the database supports the modulus operator (%) +instead of the MOD function. Defaults to false. + + SupportsMultipleNontransactionalResultSets: If true, then a @@ -1891,8 +2437,9 @@ ResultSet instances. SupportsNullDeleteAction -SupportsNullDeleteAction: Whether the database supports the -SET NULL foreign key delete action. Defaults to true. +SupportsNullDeleteAction: When true, the database supports +the SET NULL delete action on foreign keys. +Defaults to true. @@ -1971,6 +2518,21 @@ DatabaseMetaData.getPrimaryKeys as an optimization to get information about all the tables. Defaults to false. + + + + + foreign keys + + + SupportsNullUpdateAction + + +SupportsNullUpdateAction: +When true, the database supports the SET NULL update +action on foreign keys. Defaults to true. + + @@ -1998,8 +2560,24 @@ calls to java.sql.Statement.setQueryTimeout. SupportsRestrictDeleteAction -SupportsRestrictDeleteAction: Whether the database supports -the RESTRICT foreign key delete action. Defaults to true. +SupportsRestrictDeleteAction: When true, the database +supports the RESTRICT delete action on foreign keys. +Defaults to true. + + + + + + + foreign keys + + + SupportsRestrictUpdateAction + + +SupportsRestrictUpdateAction: +When true, the database supports the update +action on foreign keys. Defaults to true. @@ -2136,6 +2714,22 @@ in queries. unique constraints. Defaults to true. + + + + + DDL + + + SupportsXMLColumn + + +SupportsXMLColumn: +When true, the database supports an XML column type. See + +for information on using this capability. Defaults to false. + + @@ -2222,7 +2816,7 @@ java.sql.DatabaseMetaData.getTableInfo JDBC method. An example is: TimeTypeName: The overridden default column type for -java.sql.Types.TIME. This is only used when the schema is +java.sql.Types.TIME. This is used only when the schema is generated by the mappingtool. @@ -2237,7 +2831,7 @@ generated by the mappingtool. TimestampTypeName: The overridden default column type for -java.sql.Types.TIMESTAMP. This is only used when the schema +java.sql.Types.TIMESTAMP. This is used only when the schema is generated by the mappingtool. @@ -2252,7 +2846,7 @@ is generated by the mappingtool. TinyintTypeName: The overridden default column type for -java.sql.Types.TINYINT. This is only used when the schema is +java.sql.Types.TINYINT. This is used only when the schema is generated by the mappingtool. @@ -2286,6 +2880,66 @@ string to upper case. Use the token {0} to represent the argument. + + + + + SQL + + + TrimBothFunction + + +TrimBothFunction: +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 {1} when possible to represent the character, +and the token {0} to represent the string. +Defaults to "TRIM(BOTH {1} FROM {0})". + + + + + + + SQL + + + TrimLeadingFunction + + +TrimLeadingFunction: +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 {1} when possible to represent the character, +and the token {0} to represent the string. +Defaults to "TRIM(LEADING {1} FROM {0})". + + + + + + + SQL + + + TrimTrailingFunction + + +TrimTrailingFunction: +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 {1} when possible to represent the character, +and the token {0} to represent the string. +Defaults to "TRIM(TRAILING {1} FROM {0})". + + @@ -2414,8 +3068,8 @@ than PreparedStatement.setCharacterStream. ValidationSQL: The SQL used to validate that a connection is -still in a valid state. For example, " SELECT SYSDATE FROM DUAL - " for Oracle. +still in a valid state. For example, "SELECT SYSDATE FROM DUAL" + for Oracle. @@ -2429,7 +3083,7 @@ still in a valid state. For example, " SELECT SYSDATE FROM DUAL VarbinaryTypeName: The overridden default column type for -java.sql.Types.VARBINARY. This is only used when the schema +java.sql.Types.VARBINARY. This is used only when the schema is generated by the mappingtool. @@ -2444,10 +3098,27 @@ is generated by the mappingtool. VarcharTypeName: The overridden default column type for -java.sql.Types.VARCHAR. This is only used when the schema is +java.sql.Types.VARCHAR. This is used only when the schema is generated by the mappingtool. + + + + + DDL + + + XmlTypeName + + +XmlTypeName: +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 +mappingtool. Defaults to "XML". + + @@ -4196,3 +4867,4 @@ of which span multiple columns. +