You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Malcolm Edgar (JIRA)" <de...@cayenne.apache.org> on 2008/07/25 02:20:52 UTC

[jira] Created: (CAY-1088) Oracle TIMESTAMP handling

Oracle TIMESTAMP handling
-------------------------

                 Key: CAY-1088
                 URL: https://issues.apache.org/cayenne/browse/CAY-1088
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne Core Library
    Affects Versions: 3.0
         Environment: Cayenne 3.0 M4, Oracle 10g, Java 1.5, Windows 2003 Server, Oracle Thin JDBC Driver
            Reporter: Malcolm Edgar
            Assignee: Andrus Adamchik


We have found that Cayenne 3.0 M4 is not assigning the correct extended type for Oracle TIMESTMAP columns when using the Oracle Thin JDBC driver.

For this column type the Oracle driver ResultSetMetaData getJavaClass returns oracle.sql.TIMESTAMP. After decompiling this class we found that it extends a class called Datum which extends Object. The TIMESTAMP class does not extend java.util.Date, so Cayenne is not able to associate it with the correct extended type.

The fix for this is relatively simple, see below, but we should roll this into the core framework.

regards Malcolm Edgar

        DataDomain domain = Configuration.getSharedConfiguration().getDomain();
        
        for (Iterator<DataNode> i = domain.getDataNodes().iterator(); i.hasNext();) {
            DataNode node = i.next();

            node.getAdapter().getExtendedTypes().registerType(new OracleUtilDateType() {
                public String getClassName() {
                    return "oracle.sql.TIMESTAMP";
                }
            });
        }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.