Wednesday, March 30, 2005

Annotion-Based SQL Maps: Part II (JDK 1.5)

I show you the code sample from iBatis SQL Maps 2.0 last post.
I continue realizing the idea:


public interface MyDAO {

@Sql(expr="
SELECT
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
FROM ADDRESS
WHERE ADR_ID = ?value
")
public Address getAddress(int value);

}


Q: We need code genraotor to create a class from the SQL expression.
A: MiddleGen could help.
Q: Implement the above method using a proxy class, a runtime class-wrapper.
A: CGLIB or Javassist.
Q: Need parsing parameters in the SQL expression, and bind to method's parameters.
A: I think this can be done using in-house parser, or hacked from iBatis SQL Maps.

2 comments:

Anonymous said...

One good resource for time tracking software and many more free software alternatives is Software4YourSuccess.com
Yes it is my site and I would love for you to drop by for a second. From there you will have free access to several of my products such as The Marketing Toolbar (which is goldmine of information on how to do things quickly and on the cheap, thus saving you time and money).
Also for webmasters I have created Webmaster Wizards, which will help you with almost every aspect of putting code on your site from things such as legal and privacy disclaimers to popunders. I have so much content and free software there I could fill up this whole blog, so check it out Thanks, Sincerely Rob Rudd

ecommercewebmaster12 said...

As a top-rated company in the world of ecommerce, Infyecommercesolution has carved out a niche for itself and with the ecommerce solution provided by the company receiving accolades from clients all over the world, it has, in the true sense of the word, grown up to be a top-notch outsourcing software development company. For details on all the services provided by the company, visit http://www.infyecommercesolution.com.