You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2009/12/31 08:45:29 UTC

[jira] Issue Comment Edited: (CAY-1354) Wrong Types mapping for selected values in Row Queries

    [ https://issues.apache.org/jira/browse/CAY-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795558#action_12795558 ] 

Andrus Adamchik edited comment on CAY-1354 at 12/31/09 7:45 AM:
----------------------------------------------------------------

There are a few cases involved here:

1. A DataRow clearly belongs to a certain ObjEntity. Then we have the explicit Java type for each DB type and should return it in a DataRow. As in:

  SelectQuery q = new SelectQuery(Artist.class);
  q.setFetchingDataRows(true);

2. A DataRow can not be easily attributed to a single ObjEntity. Then the result should correspond to a default JDBC to Java mapping. This might be the case with SQLTemplate.

In your test you emulate case #2, so I don't think it is possible to match it back to the original type if such type is not a JDBC default mapping. (in addition there's a difference between the drivers in how they interpret the mapping, so it can get hairy real quick) So can you tell us which tests are failing? 

      was (Author: andrus):
    There are a few cases involved here:

1. A DataRow clearly belongs to a certain ObjEntity. Then we have the explicit Java type for each DB type and should return it in a DataRow. As in:

  SelectQuery q = new SelectQuery(Artist.class);
  q.setFetchingDataRows(true);

2. A DataRow can not be easily attributed to a single ObjEntity. Then the result should correspond to a default JDBC to Java mapping. This mught be the case with SQLTemplate.

In your test you emulate case #2, so I don't think it is possible to match it back to the original type if such type is not a JDBC default mapping. (in addition there's a difference between the drivers in how they interpret the mapping, so it can get hairy real quick) So can you tell us which tests are failing? 
  
> Wrong Types mapping for selected values in Row Queries
> ------------------------------------------------------
>
>                 Key: CAY-1354
>                 URL: https://issues.apache.org/jira/browse/CAY-1354
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Cayenne Core Library
>    Affects Versions: 3.1M1
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>            Priority: Critical
>             Fix For: 3.1M1
>
>         Attachments: CAY-1354_TEST.patch, ReturnTypesMappingTest.java
>
>
>  By default every SQL type is mapped to some Java type by modeler.
> I am expecting same behavior in common DataRow queries (without ORM).
> But in fact half of types are not mapped correctly....
> Attached JUnit test can to explain problem with more details...

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