You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (JIRA)" <ji...@apache.org> on 2012/11/12 09:38:13 UTC

[jira] [Created] (TORQUE-242) RecordMapper should use selected columns from Criteria

Thomas Fox created TORQUE-242:
---------------------------------

             Summary: RecordMapper should use selected columns from Criteria
                 Key: TORQUE-242
                 URL: https://issues.apache.org/jira/browse/TORQUE-242
             Project: Torque
          Issue Type: Improvement
          Components: Runtime, Templates
    Affects Versions: 4.0-beta1
            Reporter: Thomas Fox


Currently, when a select result is converted into objects, it is assumed that the selected columns are all columns in the table and that they are in the order as in the schema xml. This beraks if the user starts to add select rows in the criteria.
Currently one must implement a custom record mapper to deal with this situation.
It would be a nice feature if the record mapper could inspect the select crititera and map the columns accordingly. An appropriate error should be thrown if the record mapper does not map the result set.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-242) RecordMapper should use selected columns from Criteria

Posted by "Michael Wagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495169#comment-13495169 ] 

Michael Wagner commented on TORQUE-242:
---------------------------------------

A current workaround is to create a custom record mapper which overrides the processRow(ResultSet, int) method of the corresponding base record mapper.
To perform the query pass this custom mapper to org.apache.torque.util.BasePeerImpl.doSelect(Criteria, RecordMapper<TT> mapper).
                
> RecordMapper should use selected columns from Criteria
> ------------------------------------------------------
>
>                 Key: TORQUE-242
>                 URL: https://issues.apache.org/jira/browse/TORQUE-242
>             Project: Torque
>          Issue Type: Improvement
>          Components: Runtime, Templates
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>
> Currently, when a select result is converted into objects, it is assumed that the selected columns are all columns in the table and that they are in the order as in the schema xml. This beraks if the user starts to add select rows in the criteria.
> Currently one must implement a custom record mapper to deal with this situation.
> It would be a nice feature if the record mapper could inspect the select crititera and map the columns accordingly. An appropriate error should be thrown if the record mapper does not map the result set.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Resolved] (TORQUE-242) RecordMapper should use selected columns from Criteria

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

Thomas Fox resolved TORQUE-242.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0-beta2
    
> RecordMapper should use selected columns from Criteria
> ------------------------------------------------------
>
>                 Key: TORQUE-242
>                 URL: https://issues.apache.org/jira/browse/TORQUE-242
>             Project: Torque
>          Issue Type: Improvement
>          Components: Runtime, Templates
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>             Fix For: 4.0-beta2
>
>
> Currently, when a select result is converted into objects, it is assumed that the selected columns are all columns in the table and that they are in the order as in the schema xml. This beraks if the user starts to add select rows in the criteria.
> Currently one must implement a custom record mapper to deal with this situation.
> It would be a nice feature if the record mapper could inspect the select crititera and map the columns accordingly. An appropriate error should be thrown if the record mapper does not map the result set.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org