automapping and/or ignoreMissingColumns
---------------------------------------

         Key: IBATIS-115
         URL: http://issues.apache.org/jira/browse/IBATIS-115
     Project: iBatis for Java
        Type: New Feature
  Components: SQL Maps  
    Versions: 2.0.9b    
    Reporter: ow


This was requested about a year ago. Somewhat similar to what Ruby-on-Rails 
does.

http://sourceforge.net/forum/forum.php?thread_id=1110825&forum_id=206694

By: Clinton Begin - cbeginProject Admin
RE: Same name property/column automapping  
2004-07-15 16:29
This has been discussed before, and so has the inverse. That is, not all 
columns in the result map need be present in the db result set. The biggest 
argument against this is performance, as it requires accessing the DB metadata, 
possibly EVERY time a query is run. However, I don't have too much problem with 
it if it is optional. I would sooner see a syntax something like: 
 
<!-- FORCES AUTOMAP OF ALL REMAINING COLUMNS --> 
 
<resultMap id=”get-product-result” class=”com.ibatis.example.Product” 
autoMapRemaining="true"> 
<result property=”id” 
column=”ID_THAT_NEEDS_TO_BE_REMAPPED”/> 
<result property=”category” column=”categoryId” select=”getCategory”/> 
</resultMap> 
 
<!-- RELAXES REQUIREMENT THAT ALL COLUMNS MUST BE PRESENT --> 
 
<resultMap id=”get-product-result” class=”com.ibatis.example.Product”> 
<result property=”description” column=”DESC” optional="true" /> 
... 
</resultMap> 
 
<!-- OR --> 
 
<resultMap id=”get-product-result” class=”com.ibatis.example.Product” 
ignoreMissingColumns="true"> 
... 
</resultMap> 



-- 
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

Reply via email to