ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth Moorst <gazj...@yahoo.co.uk>
Subject Re: How to use sqlmap to create an object with not empty construnctor
Date Tue, 12 Sep 2006 10:57:34 GMT
The classes used in iBatis need to conform to the JavaBeans spec - they need to have a no-arg
constructor.

If you really need to use the class with a string constructor, I'd suggest returning a Map
from the sqlmap queryForObject method, then constructing your java object in your DAO.

Gareth.

----- Original Message ----
From: Anthony Hong <anthony.bin.hong@gmail.com>
To: user-java@ibatis.apache.org
Sent: Tuesday, 12 September, 2006 12:51:13 AM
Subject: Re: How to use sqlmap to create an object with not empty construnctor

I use iBatis as my DAO Layer for now. It works fine with no-args
constructor class.
Then it can setter properties in result map.
But If I have a class without no-args constuctor, how to instantiate
in iBatis,  As there is a column in selection that can be used to pass
in constructor to create a new instance, how to achieve this goal.





Mime
View raw message