You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org> on 2009/12/01 14:10:20 UTC

[jira] Created: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

oracle.sql.TIMESTAMP in Result of query
---------------------------------------

                 Key: CAY-1323
                 URL: https://issues.apache.org/jira/browse/CAY-1323
             Project: Cayenne
          Issue Type: New Feature
          Components: Cayenne Core Library
            Reporter: Evgeny Ryabitskiy
             Fix For: 3.0


Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
I think it should be mapped to standard JDBS TIMESTAMP
I am using latest official Oracle JDBC driver.

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


Re: [jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by Andrey Razumovsky <ra...@gmail.com>.
2009/12/10 Evgeny Ryabitskiy (JIRA) <ji...@apache.org>

>
> Going to commit.... may I ? :)
>

Absolutely. As a committer, you can commit your code if you don't hear any
objections. After that, you should close the issue in JIRA and update
RELEASE-NOTES.

[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784850#action_12784850 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

And last one test:

    <query factory="org.apache.cayenne.map.SQLTemplateBuilder"
        name="select4"
        root="data-map" root-name="OracleTimestampTestMap">
        <property name="cayenne.GenericSelectQuery.fetchingDataRows" value="true"/>
        <sql><![CDATA[select #result('to_timestamp(sysdate)' 'java.sql.Timestamp ' 'TTT') from dual]]></sql>
    </query>

result: 

17:33:18,502  INFO main QueryLogger:log:171 - Detected and installed adapter: org.apache.cayenne.dba.oracle.OracleAdapter
17:33:18,612  INFO main QueryLogger:logQuery:357 - select to_timestamp(sysdate) AS TTT from dual
17:33:18,831  INFO main QueryLogger:logSelectCount:401 - === returned 1 row. - took 219 ms.
17:33:18,831  INFO main QueryLogger:logCommitTransaction:434 - +++ transaction committed.
class oracle.sql.TIMESTAMP
2009-12-02 00:00:00.0


So still oracle.sql.TIMESTAMP. Even I asked for 'java.sql.Timestamp'

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 2.0.5, 3.0, 3.1M1
>
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Assigned: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik reassigned CAY-1323:
------------------------------------

    Assignee: Evgeny Ryabitskiy  (was: Andrus Adamchik)

Cool. Assigning this to Evgeny.

Good stuff. See my comments inline below...


Index: src/main/java/org/apache/cayenne/access/types/UtilDateType.java
===================================================================
-    public Object materializeObject(ResultSet rs, int index, int type) throws Exception {
+    public Date materializeObject(ResultSet rs, int index, int type) throws Exception {
         Date val = null;
 
         switch (type) {
@@ -70,28 +69,18 @@
                 val = rs.getTime(index);
                 break;
             default:
-                // here the driver can "surprise" us
-                // check the type of returned value...
-                Object object = rs.getObject(index);
-
-                if (object != null && !(object instanceof Date)) {
-                    throw new CayenneRuntimeException(
-                            "Expected an instance of java.util.Date, instead got "
-                                    + object.getClass().getName()
-                                    + ", column index: "
-                                    + index);
-                }
-
-                val = (Date) object;
+                val = rs.getDate(index);
                 break;
         }

[Andrus] Not a bad idea, however 'getDate' would lose all time data, so what if that weird object returned by the driver is a custom timestamp... Should we call 'getTimestamp()' instead? Something to figure out.


Index: src/main/java/org/apache/cayenne/dba/oracle/OracleTimestampType.java
===================================================================
+
+/**
+ * This is handler for Oracle specific type "oracle.sql.TIMESTAMP"
+ * Oracle official JDBC Driver is mapping SQL TIMESTAMP to this type
+ * Created to solve CAY-1323.
+ */
+public class OracleTimestampType extends TimestampType {
+
+    @Override
+    public String getClassName() {
+        return "oracle.sql.TIMESTAMP";
+    }
+}

[Andrus] This is a new use pattern of ExtendedTypes (till now 'materializeObject' would always return the same class or a subclass of 'getClassName'... I guess it's fine to trick Oracle. Also Oracle has a few more odd types:

http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/oracle/sql/package-summary.html

that we may want to handle in a similar fashion (at least the date/time ones)

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Fix Version/s: 3.1M1

Issue committed to trunk (3.1)
Add fix versions to 3.1.
Not closing issue because we should decide if  we are going to fix other branches

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>             Fix For: 3.1M1
>
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784833#action_12784833 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

Sory previous was for 2.0.5 Cayenne Lib

For 3.1-SNAPSHOT (current from trunk) I got Exception:


17:08:51,337  INFO main QueryLogger:logQueryStart:473 - --- will run 1 query.
17:08:51,337  INFO main QueryLogger:logBeginTransaction:427 - --- transaction started.
17:08:51,337  INFO main QueryLogger:logQuery:357 - select to_timestamp(sysdate) as TTT from dual
17:08:51,352  INFO main QueryLogger:logQueryError:453 - *** error.
java.io.StreamCorruptedException: invalid stream header
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
	at org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:112)
	at org.apache.cayenne.access.types.ExtendedTypeDecorator.materializeObject(ExtendedTypeDecorator.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:31)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:197)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.nextRow(LimitResultIterator.java:104)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.allRows(LimitResultIterator.java:85)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.processSelectResult(SQLTemplateAction.java:235)
	at org.apache.cayenne.dba.oracle.OracleSQLTemplateAction.processSelectResult(OracleSQLTemplateAction.java:83)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:167)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:123)
	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:274)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at ru.apache.cayenne.testoracle.OracleTimestampTest.main(OracleTimestampTest.java:27)
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.1-SNAPSHOT äåê 02 2009 12:21:12] Query exception.
	at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:545)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:281)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at ru.apache.cayenne.testoracle.OracleTimestampTest.main(OracleTimestampTest.java:27)
Caused by: java.io.StreamCorruptedException: invalid stream header
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
	at org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:112)
	at org.apache.cayenne.access.types.ExtendedTypeDecorator.materializeObject(ExtendedTypeDecorator.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:31)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:197)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.nextRow(LimitResultIterator.java:104)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.allRows(LimitResultIterator.java:85)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.processSelectResult(SQLTemplateAction.java:235)
	at org.apache.cayenne.dba.oracle.OracleSQLTemplateAction.processSelectResult(OracleSQLTemplateAction.java:83)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:167)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:123)
	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:274)
	... 12 more


> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784737#action_12784737 ] 

Andrus Adamchik commented on CAY-1323:
--------------------------------------

Could you provide more infomation. Cayenne Mapping can only contain JDBC types , so *where* was it mapped as oracle.sql.TIMESTAMP?

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>             Fix For: 3.0
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1.patch

Updated. + Some test coverage.
I think it's ready to commit

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785968#action_12785968 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

Maybe assign this issue to me.. cause I am resolving it? :)

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Closed: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy closed CAY-1323.
----------------------------------

    Resolution: Fixed

Committed only to 3.1 trunk.

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>             Fix For: 3.1M1
>
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1323:
---------------------------------

    Fix Version/s:     (was: 3.1M1)
                       (was: 3.0)
                       (was: 2.0.5)

Evgeny, while you are investigating this issue, I am going to unset the "Fix Version" for this jira. This is something different from "Affected Version" and it is not clear how and when this needs to be fixed.

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1.patch

After some thoughts I decide to use 'getTimeStamp()'  (as Andrus suggest).
I think there is nothing else to do in this issue. I will create another issuer for handling others Oracle types.
Going to commit.... may I ? :) 
or I should wait till someone from PMC admit it?

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784843#action_12784843 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

About #result directive.. so I add it: 

<query factory="org.apache.cayenne.map.SQLTemplateBuilder"
        name="select4"
        root="data-map" root-name="OracleTimestampTestMap">
        <property name="cayenne.GenericSelectQuery.fetchingDataRows" value="true"/>
        <sql><![CDATA[select #result('to_timestamp(sysdate)' 'java.util.Date' 'TTT') from dual]]></sql>
    </query>


And got Exception:

17:20:27,451  INFO main QueryLogger:log:171 - Detected and installed adapter: org.apache.cayenne.dba.oracle.OracleAdapter
17:20:27,560  INFO main QueryLogger:logQuery:357 - select to_timestamp(sysdate) AS TTT from dual
17:20:27,779  INFO main QueryLogger:logQueryError:453 - *** error.
org.apache.cayenne.CayenneRuntimeException: [v.3.1-SNAPSHOT äåê 02 2009 12:21:12] Expected an instance of java.util.Date, instead got oracle.sql.TIMESTAMP, column index: 1
	at org.apache.cayenne.access.types.UtilDateType.materializeObject(UtilDateType.java:78)
	at org.apache.cayenne.dba.oracle.OracleUtilDateType.materializeObject(OracleUtilDateType.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:31)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:197)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.nextRow(LimitResultIterator.java:104)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.allRows(LimitResultIterator.java:85)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.processSelectResult(SQLTemplateAction.java:235)
	at org.apache.cayenne.dba.oracle.OracleSQLTemplateAction.processSelectResult(OracleSQLTemplateAction.java:83)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:167)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:123)
	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:274)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at ru.apache.cayenne.testoracle.OracleTimestampTest.main(OracleTimestampTest.java:39)
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.1-SNAPSHOT äåê 02 2009 12:21:12] Query exception.
	at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:545)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:281)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:418)
	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:65)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:391)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:388)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:117)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:740)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:335)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:96)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1049)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1038)
	at ru.apache.cayenne.testoracle.OracleTimestampTest.main(OracleTimestampTest.java:39)
Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.1-SNAPSHOT äåê 02 2009 12:21:12] Expected an instance of java.util.Date, instead got oracle.sql.TIMESTAMP, column index: 1
	at org.apache.cayenne.access.types.UtilDateType.materializeObject(UtilDateType.java:78)
	at org.apache.cayenne.dba.oracle.OracleUtilDateType.materializeObject(OracleUtilDateType.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:50)
	at org.apache.cayenne.access.jdbc.FullRowReader.readRow(FullRowReader.java:31)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:197)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.nextRow(LimitResultIterator.java:104)
	at org.apache.cayenne.access.jdbc.LimitResultIterator.allRows(LimitResultIterator.java:85)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.processSelectResult(SQLTemplateAction.java:235)
	at org.apache.cayenne.dba.oracle.OracleSQLTemplateAction.processSelectResult(OracleSQLTemplateAction.java:83)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.execute(SQLTemplateAction.java:167)
	at org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:123)
	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:274)
	... 12 more

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 2.0.5, 3.0, 3.1M1
>
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Issue Comment Edited: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784777#action_12784777 ] 

Evgeny Ryabitskiy edited comment on CAY-1323 at 12/2/09 2:13 PM:
-----------------------------------------------------------------

on 2.0.5 branch: 
Small test that I ran on Oracle.
Result is:

class java.sql.Timestamp
2009-12-02 14:39:59.0
class oracle.sql.TIMESTAMP
2009-12-02 00:00:00.0
class java.sql.Timestamp
2009-12-02 00:00:00.0

So... result of this query:

select to_timestamp(sysdate) as TTT from dual

is mapped to class oracle.sql.TIMESTAMP that is not a JDBC driver



      was (Author: apparition):
    Small test that I ran on Oracle.
Result is:

class java.sql.Timestamp
2009-12-02 14:39:59.0
class oracle.sql.TIMESTAMP
2009-12-02 00:00:00.0
class java.sql.Timestamp
2009-12-02 00:00:00.0

So... result of this query:

select to_timestamp(sysdate) as TTT from dual

is mapped to class oracle.sql.TIMESTAMP that is not a JDBC driver


  
> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: OracleTimestampTest.java
                cayenne.xml
                OracleTimestampTestMap.map.xml

Small test that I ran on Oracle.
Result is:

class java.sql.Timestamp
2009-12-02 14:39:59.0
class oracle.sql.TIMESTAMP
2009-12-02 00:00:00.0
class java.sql.Timestamp
2009-12-02 00:00:00.0

So... result of this query:

select to_timestamp(sysdate) as TTT from dual

is mapped to class oracle.sql.TIMESTAMP that is not a JDBC driver



> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 3.0
>
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1_OracleTest.patch

JUnits to check Oracle Date/Timestamp Mapping

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1323:
---------------------------------

    Fix Version/s:     (was: 3.0)

Ok, so that's for  SQLTemplate result unmapped to objects... Here the type that we use is what the driver thinks it is (as provided via ResultSetMetadata). #result() directive is the way to override it, but I don't think Cayenne should guess here.

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784780#action_12784780 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

Driver metadata

<groupId>com.oracle.ojdbc5</groupId>
  <artifactId>ojdbc5_g</artifactId>
  <version>11.2.0.1.0</version>

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 3.0
>
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786069#action_12786069 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

[Andrus] This is a new use pattern of ExtendedTypes (till now 'materializeObject' would always return the same class or a subclass of 'getClassName'... I guess it's fine to trick Oracle. Also Oracle has a few more odd types:

http://download-east.oracle.com/otn_hosted_doc/jdeveloper/904preview/jdbc-javadoc/oracle/sql/package-summary.html

that we may want to handle in a similar fashion (at least the date/time ones) 


Re:
Love to do something new :)
Yeah! It's a large field of Oracle tunning.
Next step I am going to work with Oracle CLOBs. (Some fellas from my work have troubles with it). I have some logs.... but not even looked inside... yet.. 

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: CAY-1323_3.1.patch

Fixed!
Improved Timestamp/Date mapping for most of cases

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: CAY-1323_3.1.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Assigned: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik reassigned CAY-1323:
------------------------------------

    Assignee: Andrus Adamchik

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 3.0
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


Re: [jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by Evgeny Ryabitskiy <ev...@gmail.com>.
Ok. Now it is much clear. Thx for explaining.

Evgeny.

2009/12/2 Andrus Adamchik <an...@objectstyle.org>:
> Hi Evgeny,
>
> Let me take this to dev... Thanks for providing all the information on the
> issue and working on the fix. This is rather valuable to Cayenne, as your
> system has a number of use cases that seem to be pretty unique in this
> community, and you can find things that nobody else will. (Also hope that
> your Apache account will be created soon, so that you can take over this
> Jira and commit it yourself)
>
>> As you wrote: "Cayenne Mapping can only contain JDBC types"
>
> Let me clarify. This was referring to the DB part of the mapping. On the
> Java part we can map any custom types. And we do in fact. Cayenne is
> definitely not limited to the types listed in the JDBC spec, again on the
> object end of the mapping.
>
>> How to fix... mm have thoughts that OracleAdapter can help us... need some
>> time to look there inside
>
> Yes please.
>
> Let me comment on the fix versions to avoid misunderstanding. The fix
> versions will depend on the nature of the fix and the definition of the
> problem. Just returning an Oracle type from an unmapped query is IMO not a
> bug (actually it looks more like a bug in Oracle driver from your examples,
> and what I found via Google). On the other hand returning correct value from
> SQLTemplate with an explicit #result(), is something that we need to handle
> correctly ourselves.
>
> So the second case should probably be fixed on all stable branches.
>
> The first case would require us to redefine how Cayenne works. For instance
> we may decide that from 3.1 all Oracle internal types should be converted to
> JDBC default types (unless otherwise specified by the user). But we won't be
> able to include that change in the "stable" releases.
>
> Andrus
>
>
> On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
>>
>>   [
>> https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784887#action_12784887
>> ]
>>
>> Evgeny Ryabitskiy commented on CAY-1323:
>> ----------------------------------------
>>
>> I think I finished my Investigation. If you wish I can add some JUnit for
>> this UC.
>>
>> You can add "Fix Version" as you wish. But I think it should be fixed in
>> all branches (1.0, 2.0, 3.0).
>> It is no expectable behavior.... As you wrote: "Cayenne Mapping can only
>> contain JDBC types"
>>
>> How to fix... mm have thoughts that OracleAdapter can help us... need some
>> time to look there inside
>>
>>> oracle.sql.TIMESTAMP in Result of query
>>> ---------------------------------------
>>>
>>>               Key: CAY-1323
>>>               URL: https://issues.apache.org/jira/browse/CAY-1323
>>>           Project: Cayenne
>>>        Issue Type: Bug
>>>        Components: Cayenne Core Library
>>>  Affects Versions: 2.0.5, 3.0 beta 1
>>>          Reporter: Evgeny Ryabitskiy
>>>          Assignee: Andrus Adamchik
>>>       Attachments: cayenne.xml, OracleTimestampTest.java,
>>> OracleTimestampTestMap.map.xml
>>>
>>>
>>> Result of query from column of timestamp type was mapped to
>>> oracle.sql.TIMESTAMP.
>>> I think it should be mapped to standard JDBS TIMESTAMP
>>> I am using latest official Oracle JDBC driver.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
>

RE: Cayenne Oracle tests

Posted by Рябицкий Евгений <er...@diasoft.ru>.
Yeah... so much to do...

BTW I patially fixed that bug with oracle TIMESTAMP mapping. Think it will be fixed this weak. Was idea to add JUnit, so I will try AccessStackAdapter.

Evgeny.

-----Original Message-----
From: Andrus Adamchik [mailto:andrus@objectstyle.org] 
Sent: Thursday, December 03, 2009 3:39 PM
To: dev@cayenne.apache.org
Subject: Re: Cayenne Oracle tests

We don't have per-DB tests. There's some weak support for excluding  
certain tests on some DB's (see  
org.apache.cayenne.unit.AccessStackAdapter).

Olga recently did the research of an implementation of per-DB test  
capabilities. This hasn't been discussed yet in detail, but this is  
something that I'd like to have in 3.1... Specifically this would  
require migration of the tests to TestNG, and organizing the tests  
into "test groups". Each target database can be associated with one or  
more test groups. So DB-specific stuff can be placed in a DB-specific  
group.

For now AccessStackAdapter and subclasses are the only way to achieve  
that.

Andrus


On Dec 3, 2009, at 1:53 PM, Рябицкий Евгений wrote:

> Yeah. Thx...
> But what if I want to add some Oracle-specific test?
> Do we have some?
>
> Evgeny.
>
>
>
>
>
>
> -----Original Message-----
> From: Aristedes Maniatis [mailto:ari@maniatis.org]
> Sent: Thursday, December 03, 2009 1:44 PM
> To: dev@cayenne.apache.org
> Subject: Re: Cayenne Oracle tests
>
> On 3/12/09 8:50 PM, Рябицкий Евгений wrote:
>> Hello!
>>
>> Can some one explain me how Cayenne is tested over Oracle.
>> Just going to add some Oracle-specific JUnit test. How to do it?
>> Any example... notes... documentation?
>>
>> Evgeny.
>
> If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html
>
>
> Ari
>
>
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>


Re: Cayenne Oracle tests

Posted by Andrus Adamchik <an...@objectstyle.org>.
We don't have per-DB tests. There's some weak support for excluding  
certain tests on some DB's (see  
org.apache.cayenne.unit.AccessStackAdapter).

Olga recently did the research of an implementation of per-DB test  
capabilities. This hasn't been discussed yet in detail, but this is  
something that I'd like to have in 3.1... Specifically this would  
require migration of the tests to TestNG, and organizing the tests  
into "test groups". Each target database can be associated with one or  
more test groups. So DB-specific stuff can be placed in a DB-specific  
group.

For now AccessStackAdapter and subclasses are the only way to achieve  
that.

Andrus


On Dec 3, 2009, at 1:53 PM, Рябицкий Евгений wrote:

> Yeah. Thx...
> But what if I want to add some Oracle-specific test?
> Do we have some?
>
> Evgeny.
>
>
>
>
>
>
> -----Original Message-----
> From: Aristedes Maniatis [mailto:ari@maniatis.org]
> Sent: Thursday, December 03, 2009 1:44 PM
> To: dev@cayenne.apache.org
> Subject: Re: Cayenne Oracle tests
>
> On 3/12/09 8:50 PM, Рябицкий Евгений wrote:
>> Hello!
>>
>> Can some one explain me how Cayenne is tested over Oracle.
>> Just going to add some Oracle-specific JUnit test. How to do it?
>> Any example... notes... documentation?
>>
>> Evgeny.
>
> If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html
>
>
> Ari
>
>
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
>


RE: Cayenne Oracle tests

Posted by Рябицкий Евгений <er...@diasoft.ru>.
Yeah. Thx...
But what if I want to add some Oracle-specific test?
Do we have some?

Evgeny.


 



-----Original Message-----
From: Aristedes Maniatis [mailto:ari@maniatis.org] 
Sent: Thursday, December 03, 2009 1:44 PM
To: dev@cayenne.apache.org
Subject: Re: Cayenne Oracle tests

On 3/12/09 8:50 PM, Рябицкий Евгений wrote:
> Hello!
>
> Can some one explain me how Cayenne is tested over Oracle.
> Just going to add some Oracle-specific JUnit test. How to do it?
> Any example... notes... documentation?
>
> Evgeny.

If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html


Ari


-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Re: Cayenne Oracle tests

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On 3/12/09 8:50 PM, Рябицкий Евгений wrote:
> Hello!
>
> Can some one explain me how Cayenne is tested over Oracle.
> Just going to add some Oracle-specific JUnit test. How to do it?
> Any example... notes... documentation?
>
> Evgeny.

If you want to run the unit tests... http://cayenne.apache.org/running-unit-tests.html


Ari


-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Cayenne Oracle tests

Posted by Рябицкий Евгений <er...@diasoft.ru>.
Hello!

Can some one explain me how Cayenne is tested over Oracle.
Just going to add some Oracle-specific JUnit test. How to do it?
Any example... notes... documentation? 

Evgeny.







On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
>    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784887 
> #action_12784887 ]
>
> Evgeny Ryabitskiy commented on CAY-1323:
> ----------------------------------------
>
> I think I finished my Investigation. If you wish I can add some  
> JUnit for this UC.
>
> You can add "Fix Version" as you wish. But I think it should be  
> fixed in all branches (1.0, 2.0, 3.0).
> It is no expectable behavior.... As you wrote: "Cayenne Mapping can  
> only contain JDBC types"
>
> How to fix... mm have thoughts that OracleAdapter can help us...  
> need some time to look there inside
>
>> oracle.sql.TIMESTAMP in Result of query
>> ---------------------------------------
>>
>>                Key: CAY-1323
>>                URL: https://issues.apache.org/jira/browse/CAY-1323
>>            Project: Cayenne
>>         Issue Type: Bug
>>         Components: Cayenne Core Library
>>   Affects Versions: 2.0.5, 3.0 beta 1
>>           Reporter: Evgeny Ryabitskiy
>>           Assignee: Andrus Adamchik
>>        Attachments: cayenne.xml, OracleTimestampTest.java,  
>> OracleTimestampTestMap.map.xml
>>
>>
>> Result of query from column of timestamp type was mapped to  
>> oracle.sql.TIMESTAMP.
>> I think it should be mapped to standard JDBS TIMESTAMP
>> I am using latest official Oracle JDBC driver.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


Re: [jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Evgeny,

Let me take this to dev... Thanks for providing all the information on  
the issue and working on the fix. This is rather valuable to Cayenne,  
as your system has a number of use cases that seem to be pretty unique  
in this community, and you can find things that nobody else will.  
(Also hope that your Apache account will be created soon, so that you  
can take over this Jira and commit it yourself)

> As you wrote: "Cayenne Mapping can only contain JDBC types"

Let me clarify. This was referring to the DB part of the mapping. On  
the Java part we can map any custom types. And we do in fact. Cayenne  
is definitely not limited to the types listed in the JDBC spec, again  
on the object end of the mapping.

> How to fix... mm have thoughts that OracleAdapter can help us...  
> need some time to look there inside

Yes please.

Let me comment on the fix versions to avoid misunderstanding. The fix  
versions will depend on the nature of the fix and the definition of  
the problem. Just returning an Oracle type from an unmapped query is  
IMO not a bug (actually it looks more like a bug in Oracle driver from  
your examples, and what I found via Google). On the other hand  
returning correct value from SQLTemplate with an explicit #result(),  
is something that we need to handle correctly ourselves.

So the second case should probably be fixed on all stable branches.

The first case would require us to redefine how Cayenne works. For  
instance we may decide that from 3.1 all Oracle internal types should  
be converted to JDBC default types (unless otherwise specified by the  
user). But we won't be able to include that change in the "stable"  
releases.

Andrus


On Dec 2, 2009, at 6:16 PM, Evgeny Ryabitskiy (JIRA) wrote:
>    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784887 
> #action_12784887 ]
>
> Evgeny Ryabitskiy commented on CAY-1323:
> ----------------------------------------
>
> I think I finished my Investigation. If you wish I can add some  
> JUnit for this UC.
>
> You can add "Fix Version" as you wish. But I think it should be  
> fixed in all branches (1.0, 2.0, 3.0).
> It is no expectable behavior.... As you wrote: "Cayenne Mapping can  
> only contain JDBC types"
>
> How to fix... mm have thoughts that OracleAdapter can help us...  
> need some time to look there inside
>
>> oracle.sql.TIMESTAMP in Result of query
>> ---------------------------------------
>>
>>                Key: CAY-1323
>>                URL: https://issues.apache.org/jira/browse/CAY-1323
>>            Project: Cayenne
>>         Issue Type: Bug
>>         Components: Cayenne Core Library
>>   Affects Versions: 2.0.5, 3.0 beta 1
>>           Reporter: Evgeny Ryabitskiy
>>           Assignee: Andrus Adamchik
>>        Attachments: cayenne.xml, OracleTimestampTest.java,  
>> OracleTimestampTestMap.map.xml
>>
>>
>> Result of query from column of timestamp type was mapped to  
>> oracle.sql.TIMESTAMP.
>> I think it should be mapped to standard JDBS TIMESTAMP
>> I am using latest official Oracle JDBC driver.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784887#action_12784887 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

I think I finished my Investigation. If you wish I can add some JUnit for this UC.

You can add "Fix Version" as you wish. But I think it should be fixed in all branches (1.0, 2.0, 3.0).
It is no expectable behavior.... As you wrote: "Cayenne Mapping can only contain JDBC types"

How to fix... mm have thoughts that OracleAdapter can help us... need some time to look there inside

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Issue Comment Edited: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12785966#action_12785966 ] 

Evgeny Ryabitskiy edited comment on CAY-1323 at 12/4/09 3:48 PM:
-----------------------------------------------------------------

Fixed!
Improved Timestamp/Date mapping for most of cases

Patch is only for 3.1 trunk.

Still need to think what to do with other branches

      was (Author: apparition):
    Fixed!
Improved Timestamp/Date mapping for most of cases
  
> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Commented: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12786065#action_12786065 ] 

Evgeny Ryabitskiy commented on CAY-1323:
----------------------------------------

[Andrus] Not a bad idea, however 'getDate' would lose all time data, so what if that weird object returned by the driver is a custom timestamp... Should we call 'getTimestamp()' instead? Something to figure out. 

Re;
It's UtilDateType.java  class and  it's expecting to return java.util.Date.

 'getDate'  returns 'java.sql.Date'
There are no deferents between 'java.sql.Date'  and ' java.util.Date'

if we use 'getTimestamp()' we got 'java.sql.Timestamp'
Only deferents between Timestamp and Date is nanoseconds.
We don't need nanoseconds, because we converting to ' java.util.Date' and nanoseconds will be dropped.

So I think it is right method in right place. No lose of time data.

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>         Attachments: CAY-1323_3.1.patch, CAY-1323_3.1_OracleTest.patch, cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment: OracleTimestampTestMap.map.xml

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>             Fix For: 3.0
>
>         Attachments: OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Attachment:     (was: OracleTimestampTestMap.map.xml)

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: New Feature
>          Components: Cayenne Core Library
>            Reporter: Evgeny Ryabitskiy
>             Fix For: 3.0
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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


[jira] Updated: (CAY-1323) oracle.sql.TIMESTAMP in Result of query

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1323:
-----------------------------------

    Affects Version/s: 2.0.5
                       3.0 beta 1
        Fix Version/s: 3.1M1
                       3.0
                       2.0.5
           Issue Type: Bug  (was: New Feature)

Update version affect: for both 2.0 and 3.0
Sure it can be simulated on 1.2

> oracle.sql.TIMESTAMP in Result of query
> ---------------------------------------
>
>                 Key: CAY-1323
>                 URL: https://issues.apache.org/jira/browse/CAY-1323
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 2.0.5, 3.0 beta 1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Andrus Adamchik
>             Fix For: 2.0.5, 3.0, 3.1M1
>
>         Attachments: cayenne.xml, OracleTimestampTest.java, OracleTimestampTestMap.map.xml
>
>
> Result of query from column of timestamp type was mapped to oracle.sql.TIMESTAMP.
> I think it should be mapped to standard JDBS TIMESTAMP
> I am using latest official Oracle JDBC driver.

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