ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Property/Field resolution order
Date Wed, 09 Sep 2009 14:43:47 GMT
Worry not, I don't see us changing this anytime soon, especially given that
there's already a workaround and common behavior with other frameworks.
 It's still worth a feature request in Jira though.
Here's a post that just came up today regarding JPA and the same discussion.

http://java.dzone.com/articles/jpa-implementation-patterns-7

Clinton

On Tue, Sep 8, 2009 at 8:16 AM, Gustavo Henrique Sberze Ribas <
gribas@cpqd.com.br> wrote:

> > 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-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Mime
View raw message