|
From: Stephen C. <sc...@us...> - 2002-10-31 05:27:43
|
User: scoy
Date: 02/10/30 21:27:42
Modified: src/etc/conf/default Tag: Branch_3_2
standardjbosscmp-jdbc.xml
Log:
Refined mappings for Oracle 9i, Postgres and mysql by running against the cmp2 test suite.
In particular, mapping java.lang.Object to JAVA_OBJECT is almost always completely wrong.
Revision Changes Path
No revision
No revision
1.39.2.8 +41 -25 jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml
Index: standardjbosscmp-jdbc.xml
===================================================================
RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml,v
retrieving revision 1.39.2.7
retrieving revision 1.39.2.8
diff -u -r1.39.2.7 -r1.39.2.8
--- standardjbosscmp-jdbc.xml 3 Oct 2002 06:40:05 -0000 1.39.2.7
+++ standardjbosscmp-jdbc.xml 31 Oct 2002 05:27:42 -0000 1.39.2.8
@@ -7,7 +7,7 @@
<!-- -->
<!-- ===================================================================== -->
-<!-- $Id: standardjbosscmp-jdbc.xml,v 1.39.2.7 2002/10/03 06:40:05 scoy Exp $ -->
+<!-- $Id: standardjbosscmp-jdbc.xml,v 1.39.2.8 2002/10/31 05:27:42 scoy Exp $ -->
<jbosscmp-jdbc>
@@ -486,11 +486,11 @@
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
+ <jdbc-type>BLOB</jdbc-type>
<sql-type>BLOB</sql-type>
<!--
- | Change this from BLOB to RAW(255) if you know your
- | serialized object will be <= 255 bytes
+ | Change this from BLOB to RAW(n) if you know your
+ | serialized object will be <= n bytes and n <= 2000
-->
</mapping>
</type-mapping>
@@ -623,8 +623,8 @@
<jdbc-type>BLOB</jdbc-type>
<sql-type>BLOB</sql-type>
<!--
- | Change this from BLOB to RAW(255) if you know your
- | serialized object will be <= 255 bytes
+ | Change this from BLOB to RAW(n) if you know your
+ | serialized object will be <= n bytes and n <= 2000
-->
</mapping>
</type-mapping>
@@ -749,11 +749,12 @@
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
+ <jdbc-type>LONGVARBINARY</jdbc-type>
<sql-type>LONG RAW</sql-type>
<!--
- | Change this from LONG RAW to RAW(255) if you know your
- | serialized object will be <= 255 bytes
+ | Change this from LONG RAW to RAW(n) if you know your
+ | serialized object will be <= n bytes and n <= 2000
+ | Oracle only permits one LONG type per table
-->
</mapping>
</type-mapping>
@@ -957,8 +958,8 @@
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
- <sql-type>OID</sql-type>
+ <jdbc-type>VARBINARY</jdbc-type>
+ <sql-type>BYTEA</sql-type>
</mapping>
</type-mapping>
@@ -1079,7 +1080,7 @@
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
+ <jdbc-type>VARBINARY</jdbc-type>
<sql-type>BYTEA</sql-type>
</mapping>
</type-mapping>
@@ -1151,8 +1152,9 @@
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
- <sql-type>OBJECT</sql-type>
+ <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
+ <jdbc-type>VARBINARY</jdbc-type>
+ <sql-type>VARBINARY</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Short</java-type>
@@ -1204,12 +1206,6 @@
<jdbc-type>DECIMAL</jdbc-type>
<sql-type>DECIMAL</sql-type>
</mapping>
- <mapping>
- <java-type>java.lang.Object</java-type>
- <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
- <jdbc-type>VARBINARY</jdbc-type>
- <sql-type>VARBINARY</sql-type>
- </mapping>
</type-mapping>
<type-mapping>
@@ -1412,8 +1408,13 @@
<sql-type>TINYINT</sql-type>
</mapping>
<mapping>
+ <java-type>java.math.BigDecimal</java-type>
+ <jdbc-type>DOUBLE</jdbc-type>
+ <sql-type>DOUBLE</sql-type>
+ </mapping>
+ <mapping>
<java-type>java.lang.Object</java-type>
- <jdbc-type>JAVA_OBJECT</jdbc-type>
+ <jdbc-type>BLOB</jdbc-type>
<sql-type>LONGBLOB</sql-type>
<!--
| Change this from LONGBLOB to BLOB if you know your
@@ -1434,6 +1435,10 @@
<java-type>java.sql.Timestamp</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>TIMESTAMP</sql-type>
+ <!--
+ | This type is problematical because mysql does not have any
+ | date/time types that store milliseconds. You should avoid it.
+ -->
</mapping>
<mapping>
<java-type>java.lang.Byte</java-type>
@@ -1459,6 +1464,10 @@
<java-type>java.util.Date</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>DATETIME</sql-type>
+ <!--
+ | Note that you lose granularity here
+ | Use a numeric type and store milliseconds if you really need it
+ -->
</mapping>
<mapping>
<java-type>java.sql.Date</java-type>
@@ -1468,9 +1477,8 @@
<mapping>
<java-type>java.sql.Time</java-type>
<jdbc-type>TIME</jdbc-type>
- <sql-type>BIGINT</sql-type>
+ <sql-type>TIME</sql-type>
</mapping>
-
</type-mapping>
<type-mapping>
@@ -1564,9 +1572,13 @@
<sql-type>TINYINT</sql-type>
</mapping>
<mapping>
+ <!--
+ | Note that you lose granularity here
+ | Use a numeric type and store milliseconds if you really need it
+ -->
<java-type>java.sql.Timestamp</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
- <sql-type>TIMESTAMP</sql-type>
+ <sql-type>DATETIME</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Date</java-type>
@@ -1689,9 +1701,13 @@
</mapping>
<mapping>
+ <!--
+ | Note that you lose granularity here
+ | Use a numeric type and store milliseconds if you really need it
+ -->
<java-type>java.sql.Timestamp</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
- <sql-type>TIMESTAMP</sql-type>
+ <sql-type>DATETIME</sql-type>
</mapping>
<mapping>
|