Dependencies for statements in sql-Maps
---------------------------------------

         Key: IBATIS-155
         URL: http://issues.apache.org/jira/browse/IBATIS-155
     Project: iBatis for Java
        Type: New Feature
  Components: SQL Maps  
 Environment: all
    Reporter: Steffen Legler
    Priority: Minor


i am using ibatis with ~120 sql-Maps.
When a java object arrives, the software should call in most cases a select and 
update statement. This works fine.

But there are other cases, where the software should call for example an insert 
statement before calling an update-statetement.

I think it would be useful, if there is an attribute like depends added to the 
xml-tags statement, insert, update, delete, so that ibatis automatically 
executes the insert statement when calling the update-statement. 

For example:
        <insert id="insert" parameterClass="class1">
                insert into....
        </insert>

        <update id="update" parameterClass="class1" depends="insert">
                update ...
        </update>

Java-execute:
    sqlMapClient.update("namespace:update",class1);

In this case the software tries to execute the statement "namespace:update" and 
ibatis executes two statements:
  namespace:insert
  namespace.update

The advantage of this solution is, that you are not depending on the support of 
multiple sql-Statements from the jdbc-driver.

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