You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Mario Alberto Chavez (JIRA)" <ib...@incubator.apache.org> on 2006/04/18 19:44:19 UTC

[jira] Created: (IBATISNET-154) Support for SelectKey to use a complex resultMap

Support for SelectKey to use a complex resultMap
------------------------------------------------

         Key: IBATISNET-154
         URL: http://issues.apache.org/jira/browse/IBATISNET-154
     Project: iBatis for .NET
        Type: Improvement

  Components: DataMapper  
    Versions: DataMapper 1.3    
 Environment: Windows XP64, VSNET 2005
    Reporter: Mario Alberto Chavez
    Priority: Minor


The insert tag support the use of SelectKey to return the key generated at server side for that specific record, but it's limited to only return a scalar value, there are time that when a record is inserted more that the key is calculated at server side, and those fields have to come back to the object, the only work around right now is to insert the record and after that have a select by id action in order to get new generated fields.

I will be useful if selectkey can support a complex - not scalar - resultmap to address this case in one declaration.

Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATISNET-154) Support for SelectKey to use a complex resultMap

Posted by "Mario Alberto Chavez (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATISNET-154?page=comments#action_12376352 ] 

Mario Alberto Chavez commented on IBATISNET-154:
------------------------------------------------

Gilles;

Sorry to respond this late, but  as Ron said, some times it's required to get more than a key from the database when a record is inserted, My first approach was to use a Stored procedure as you said, but it adds a bit of complexity, because I can not use any more the auto generated insert sql from ibatis and I have to code a SP, or I have to use to sql commands, the first one to get the key, the second one to get the additional data.

I feel that i will be more clean of selectKey can support a complex result map.

Thanks
Mario

> Support for SelectKey to use a complex resultMap
> ------------------------------------------------
>
>          Key: IBATISNET-154
>          URL: http://issues.apache.org/jira/browse/IBATISNET-154
>      Project: iBatis for .NET
>         Type: Improvement

>   Components: DataMapper
>     Versions: DataMapper 1.3
>  Environment: Windows XP64, VSNET 2005
>     Reporter: Mario Alberto Chavez
>     Assignee: Gilles Bayon
>     Priority: Minor

>
> The insert tag support the use of SelectKey to return the key generated at server side for that specific record, but it's limited to only return a scalar value, there are time that when a record is inserted more that the key is calculated at server side, and those fields have to come back to the object, the only work around right now is to insert the record and after that have a select by id action in order to get new generated fields.
> I will be useful if selectkey can support a complex - not scalar - resultmap to address this case in one declaration.
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATISNET-154) Support for SelectKey to use a complex resultMap

Posted by "Gilles Bayon (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATISNET-154?page=all ]
     
Gilles Bayon closed IBATISNET-154:
----------------------------------

    Resolution: Won't Fix
     Assign To: Gilles Bayon

I don't see how you can do it without use of a stored procedure or with use of two statements.

iBATIS already allows you to use simply the 2 solutions.


> Support for SelectKey to use a complex resultMap
> ------------------------------------------------
>
>          Key: IBATISNET-154
>          URL: http://issues.apache.org/jira/browse/IBATISNET-154
>      Project: iBatis for .NET
>         Type: Improvement

>   Components: DataMapper
>     Versions: DataMapper 1.3
>  Environment: Windows XP64, VSNET 2005
>     Reporter: Mario Alberto Chavez
>     Assignee: Gilles Bayon
>     Priority: Minor

>
> The insert tag support the use of SelectKey to return the key generated at server side for that specific record, but it's limited to only return a scalar value, there are time that when a record is inserted more that the key is calculated at server side, and those fields have to come back to the object, the only work around right now is to insert the record and after that have a select by id action in order to get new generated fields.
> I will be useful if selectkey can support a complex - not scalar - resultmap to address this case in one declaration.
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATISNET-154) Support for SelectKey to use a complex resultMap

Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATISNET-154?page=comments#action_12376343 ] 

Ron Grabowski commented on IBATISNET-154:
-----------------------------------------

I think the entire patch would be just two lines of code:

 selectKey.ResultMapName = NodeUtils.GetStringAttribute(prop, "resultMap");
 selectKey.RemapResults = NodeUtils.GetBooleanAttribute(prop, "remapResults", false); 

Sometimes a key and a Date column is populated when an INSERT occurs. Adding support for a resultMap on the selectKey would allow the user to get back that information as an object.

+0




> Support for SelectKey to use a complex resultMap
> ------------------------------------------------
>
>          Key: IBATISNET-154
>          URL: http://issues.apache.org/jira/browse/IBATISNET-154
>      Project: iBatis for .NET
>         Type: Improvement

>   Components: DataMapper
>     Versions: DataMapper 1.3
>  Environment: Windows XP64, VSNET 2005
>     Reporter: Mario Alberto Chavez
>     Assignee: Gilles Bayon
>     Priority: Minor

>
> The insert tag support the use of SelectKey to return the key generated at server side for that specific record, but it's limited to only return a scalar value, there are time that when a record is inserted more that the key is calculated at server side, and those fields have to come back to the object, the only work around right now is to insert the record and after that have a select by id action in order to get new generated fields.
> I will be useful if selectkey can support a complex - not scalar - resultmap to address this case in one declaration.
> Thanks

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira