Hi Clinton,
Thank you for taking interest in my case.
I'd like to access this to create some sql fragment.
In my web pages I have a list where users can define dynamic criteria.
for this to work I have to send the actual name of the column.
But if I would create some method that translates a particular property
to his sql column based on the resultmap, I could use propertynames and
not sql column names.
So:
In webpage: propertyName / value / [AND | OR]
Add filter
In page handler(struts action):
Create criteria (I use a own version of the Criteria class in
ORB)
Send it with DAO
In DAO:
Set the Criteria in the SqlQuery class
<select id="getPojos" parameterClass="org.foo.SqlQuery"
resultClass="org.foo.Pojo">
SELECT *
FROM `pojos`
WHERE
<dynamic>
<isNotEmpty property="whereCriteriaString">
$whereCriteriaString$
</isNotEmpty>
</dynamic>
</select>
So it is in the Criteria class I would create a method that
handles the conversion.
Greetz,
Kris.
-----Oorspronkelijk bericht-----
Van: Clinton Begin [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 31 december 2004 18:38
Aan: [email protected]
Onderwerp: Re: access a resultmap
I'd be more interested in why. ;-)
The short answer to your question is "no". But of course, there's ways.
What are you trying to do?
Cheers,
Clinton
On Fri, 31 Dec 2004 17:26:38 +0100, Kris Barnhoorn <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I was wondering if you can access a resultmap through the iBatis API
> To know what sql column is attached to a specific property
>
> something like
>
> ResultMap rm = getResultMap("rmName");
> rm.getColumnOfProperty("reference");
>
> Thank you,
> Kris.
>
>