use label from sql for mapping
------------------------------
Key: IBATIS-119
URL: http://issues.apache.org/jira/browse/IBATIS-119
Project: iBatis for Java
Type: New Feature
Components: SQL Maps
Environment: N/A
Reporter: Dharmendra Chauhan
Priority: Minor
Simple way to map bean properties to sql column is by labels. e.g. If I provide
contact bean to iBatis for sql select from contact_data table, I can write sql
like this to avoid verbose mapping (though not very clean!):
"select first_name as firstname, last_name as lastname, mobile_phone as
phone.mobile from contact_data as contact"
Here I am mapping contact_data table to contact object, first_name to firstname
property of contact object(contact.firstname), mobile_phone to
contact.phone.mobile, etc. ...
Same concept can be extended for xml mapping also where instead of object
property with '.' notation, I use xpath in sql label to map result to return
xml.
"select first_name as name/first, last_name as name/last, mobile_phone as
access/phone/mobile from contact as contact-root-element"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira