Hello there,

I was wondering if it would be possible to add object post processing
capabilities to iBatis.

We have found the need to set fields within business objects after they
have been read from a database using iBatis. Up until now we have been using
the row handler callback, however, when using iBatis lazy loading, this
does no longer suffice.

To counter this we have added an interface to the iBatis package to
allow for any implementors to be called after the object has been
created and populated.

Below is the implementation that we have used, we feel that it would be
a handy feature for the standard iBatis implementation.

Please let me know if this is possible.

Many thanks in advance,

Mark

---------------------------------------

package com.ibatis.sqlmap.engine.mapping.statement;
/**
 * Post processor for ibatis created business objects.
 * @author mima
 */
public interface IPostProcessor {
        /**
         * The callback called immediately after an object has been created
and
populated.
         * @param results The result data. 
         */
        void postProcessCallback(Object[] results);
}

--------------------------------------

com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback

  public void handleResultObject(
     .... CODE REMOVED
      rowHandler.handleRow(object);

      if (object instanceof IPostProcessor) {
          ((IPostProcessor) object).postProcessCallback(results);
      }
      
    }
}
-- 
View this message in context: 
http://www.nabble.com/Object-post-processor-feature-request.-tp23250996p23250996.html
Sent from the iBATIS - Dev mailing list archive at Nabble.com.

Reply via email to