You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ryan Shelley (JIRA)" <ib...@incubator.apache.org> on 2008/03/07 09:41:46 UTC

[jira] Created: (IBATIS-493) Add Abator config to utilize resultMap "select" attribute.

Add Abator config to utilize resultMap "select" attribute.
----------------------------------------------------------

                 Key: IBATIS-493
                 URL: https://issues.apache.org/jira/browse/IBATIS-493
             Project: iBatis for Java
          Issue Type: Improvement
          Components: Build/Deployment
    Affects Versions: 2.3.1
            Reporter: Ryan Shelley
            Priority: Minor


The iBATIS SQLMaps resultMap element supports a "select" attribute that maps to another "select" statement to nest complex resultMaps.  It would be helpful to allow Abator to provide a configuration option to the "table" element that would map two tables together by Primary Key, ultimately, generating a resultMap implementing the "select" attribute.  This would be helpful for tables where two tables are intrinsically linked.  The only way around this currently is to create a custom SQLMap, ResultMap, Model, and DAO method outside the scope of Abator, which could become out of sync as Abator is used to rebuild Models, Maps, and Statements.

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


[jira] Commented: (IBATIS-493) Add Abator config to utilize resultMap "select" attribute

Posted by "Jeff Butler (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576407#action_12576407 ] 

Jeff Butler commented on IBATIS-493:
------------------------------------

I strongly disagree with the premise of your last comment.  iBATIS has many features that are not reflected in the code generated by Abator.  This in no way implies that we don't recommend using those features.

I suggest that you read the introductory documentation page for Abator - this describes the purpose of the tool.  We do not expect the tool to do *everything* for you - you must still do a little work.  Abator is for cutting down a lot of the nuisance work.  You might also look at the "philosophy" page.  We talk more about the usage of the tool there.


> Add Abator config to utilize resultMap "select" attribute
> ---------------------------------------------------------
>
>                 Key: IBATIS-493
>                 URL: https://issues.apache.org/jira/browse/IBATIS-493
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Ryan Shelley
>            Priority: Minor
>
> The iBATIS SQLMaps resultMap element supports a "select" attribute that maps to another "select" statement to nest complex resultMaps.  It would be helpful to allow Abator to provide a configuration option to the "table" element that would map two tables together by Primary Key, ultimately, generating a resultMap implementing the "select" attribute.  This would be helpful for tables where two tables are intrinsically linked.  The only way around this currently is to create a custom SQLMap, ResultMap, Model, and DAO method outside the scope of Abator, which could become out of sync as Abator is used to rebuild Models, Maps, and Statements.

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


[jira] Commented: (IBATIS-493) Add Abator config to utilize resultMap "select" attribute

Posted by "Jeff Butler (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576176#action_12576176 ] 

Jeff Butler commented on IBATIS-493:
------------------------------------

This has been discussed on the lists many times.  I did a serious investigation of this topic sometime back and its quite complex to solve in a general way.  In fact, the situation you describe would better be solved by a groupBy rather than a resultMap select.  But this case is only the most simple of cases - this problem can quickly balloon into a very complex problem indeed.  What if a table is linked to more than one other table (as is quite common)?  What if the linking goes many layers deep?  Also, some of the limitations of iBATIS itself add to the difficulties.

In the end, my feeling about this is that the work of configuring Abator to deal with table relationships is more difficult than simply extending the generated result maps and objects.  Everything you describe can be accomplished by extending generated objects - which is very simple.

I'll leave this open for now to allow additional comments from the interested parties.


> Add Abator config to utilize resultMap "select" attribute
> ---------------------------------------------------------
>
>                 Key: IBATIS-493
>                 URL: https://issues.apache.org/jira/browse/IBATIS-493
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Ryan Shelley
>            Priority: Minor
>
> The iBATIS SQLMaps resultMap element supports a "select" attribute that maps to another "select" statement to nest complex resultMaps.  It would be helpful to allow Abator to provide a configuration option to the "table" element that would map two tables together by Primary Key, ultimately, generating a resultMap implementing the "select" attribute.  This would be helpful for tables where two tables are intrinsically linked.  The only way around this currently is to create a custom SQLMap, ResultMap, Model, and DAO method outside the scope of Abator, which could become out of sync as Abator is used to rebuild Models, Maps, and Statements.

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


[jira] Commented: (IBATIS-493) Add Abator config to utilize resultMap "select" attribute

Posted by "Ryan Shelley (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576420#action_12576420 ] 

Ryan Shelley commented on IBATIS-493:
-------------------------------------

I stand corrected and apologize for my insinuation.  I don't intend it to do everything for me, but the purpose of listing "improvements" are for people to see value in the software, and want to see it succeed by providing input, that's all.  If it's a feature of iBATIS that no one is comfortable including in Abator, then so be it.  Having the ability to extend the model object from a superclass helps resolve this problem (by creating a superclass that contains a List of models), so that may just be enough.

> Add Abator config to utilize resultMap "select" attribute
> ---------------------------------------------------------
>
>                 Key: IBATIS-493
>                 URL: https://issues.apache.org/jira/browse/IBATIS-493
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Ryan Shelley
>            Priority: Minor
>
> The iBATIS SQLMaps resultMap element supports a "select" attribute that maps to another "select" statement to nest complex resultMaps.  It would be helpful to allow Abator to provide a configuration option to the "table" element that would map two tables together by Primary Key, ultimately, generating a resultMap implementing the "select" attribute.  This would be helpful for tables where two tables are intrinsically linked.  The only way around this currently is to create a custom SQLMap, ResultMap, Model, and DAO method outside the scope of Abator, which could become out of sync as Abator is used to rebuild Models, Maps, and Statements.

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


[jira] Commented: (IBATIS-493) Add Abator config to utilize resultMap "select" attribute

Posted by "Ryan Shelley (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576294#action_12576294 ] 

Ryan Shelley commented on IBATIS-493:
-------------------------------------

My main reason for bringing this up is that iBATIS provides this functionality, so by explicitly deciding not to include it in Abator, it's implied that "iBATIS supports this, but we don't recommend it".  I can think of many reasons why cascading selects are helpful, but I can understand the logic to dissuade it's use.  It is most certainly not the most optimal option to include in your model every time, but there are the rare occasions where it really makes sense and simplifies development.  I'm not insinuating that Abator do any more work than simply translate someone's "columnOverride" into a List of Models and apply a "select" reference to it.  Then leave it up to the developer and iBATIS to implement it properly.

> Add Abator config to utilize resultMap "select" attribute
> ---------------------------------------------------------
>
>                 Key: IBATIS-493
>                 URL: https://issues.apache.org/jira/browse/IBATIS-493
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Ryan Shelley
>            Priority: Minor
>
> The iBATIS SQLMaps resultMap element supports a "select" attribute that maps to another "select" statement to nest complex resultMaps.  It would be helpful to allow Abator to provide a configuration option to the "table" element that would map two tables together by Primary Key, ultimately, generating a resultMap implementing the "select" attribute.  This would be helpful for tables where two tables are intrinsically linked.  The only way around this currently is to create a custom SQLMap, ResultMap, Model, and DAO method outside the scope of Abator, which could become out of sync as Abator is used to rebuild Models, Maps, and Statements.

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