Monday, March 28, 2005

Idea on Annotaion-based iBATIS SQLMaps (JDK 1.5)

This is my proposal for hacking iBATIS SQLMaps to be annotation-based version.
After looking at the example, I saw the following code:

id="getAddress" parameterClass="int"
ADR_ID as id,
ADR_DESCRIPTION as description,
ADR_STREET as street,
ADR_CITY as city,
ADR_PROVINCE as province,
ADR_POSTAL_CODE as postalCode
where ADR_ID = #value#

can be changed to annotation attaching on a method of a Java interface.
#value# should be able to bind with the parameter, like this:

@Sql("select ... ")
public Address getAttress(int value);

Proxy-based AOP is enough for this implementation. A proxy class can be geneated at runtime, using the technique I proposed in SQLWarp.


1 comment:

Admin said...

Great blog, keep up the good work. Glad to see sites like this.

Here is another good site I said I would pass along.
Domain Names For Sale