> Does anyone actually care if iBATIS uses getter/setters instead of
fields directly?

  I don't care, as long as it keeps support to java beans
getters/setters or implement some sort of column to method mapping like
Brandon suggested.

  We have a special float point data array stored as a blob in the
database. We then take advantage of iBATIS getters/setters support to do
the conversion. Here's an example:


public class JBean {

   private float[] dataPoints;

   // Used only by iBATIS
   protected byte[] getPointsAsByteStream() {
     // uncanny reconversion
     ...
   }

   // Used only by iBATIS
   protected void setPointsAsByteStream(byte[] points) {
     // uncanny conversion
     ...
   }

   // Used by all others
   public float[] getDataPoints() { return dataPoints; }
   public void setDataPoints(float[] points) { this.dataPoints = points;
}
}

<resultMap class="JBean" id="jbeanResultMap">
    <result property="pointsAsByteStream" column="POINTS"
jdbcType="BLOB" />
</resultMap>


Regards,
Gustavo

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to