|
From: Stephen C. <sc...@us...> - 2002-10-31 02:30:28
|
User: scoy
Date: 02/10/30 18:30:27
Modified: src/etc/conf/default Tag: Branch_3_0
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.23.2.22 +41 -24 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.23.2.21
retrieving revision 1.23.2.22
diff -u -r1.23.2.21 -r1.23.2.22
--- standardjbosscmp-jdbc.xml 3 Oct 2002 06:38:40 -0000 1.23.2.21
+++ standardjbosscmp-jdbc.xml 31 Oct 2002 02:30:26 -0000 1.23.2.22
@@ -7,7 +7,7 @@
<!-- -->
<!-- ===================================================================== -->
-<!-- $Id: standardjbosscmp-jdbc.xml,v 1.23.2.21 2002/10/03 06:38:40 scoy Exp $ -->
+<!-- $Id: standardjbosscmp-jdbc.xml,v 1.23.2.22 2002/10/31 02:30:26 scoy Exp $ -->
<jbosscmp-jdbc>
@@ -393,11 +393,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>
@@ -530,8 +530,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>
@@ -656,11 +656,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>
@@ -864,8 +865,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>
@@ -986,7 +987,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>
@@ -1058,8 +1059,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>
@@ -1111,12 +1113,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>
@@ -1318,8 +1314,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
@@ -1340,6 +1341,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>
@@ -1365,6 +1370,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>
@@ -1374,7 +1383,7 @@
<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>
@@ -1469,9 +1478,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>
@@ -1594,9 +1607,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>
|