Phillip S wrote:
Team,
I am having some problems with struct and searched the archives. I
found an article indicating IBATIS does not support struct. Can anyone
else please confirm that?
Thanks
See what you’re getting into…before you go there See it!
<http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507>
I ran into that once. No, you can't use structs. You also can't use
public members, as I seem to remember being burnt by that one too.
(Happened to me when I tried to use ASP.NET's Pair class or something
like that.)
Use classes with properties that have getters and setters (although the
property, getter, and setter can be private).
If you need something small just for passing into a query, try
parameterClass="map" and pass in a Dictionary object. E.g.,
Dictionary<string, object> param = new Dictionary<string, object>();
param.Add("DaLastName", "Piasecki");
param.Add("DaFirstName", "Nicholas");
LocalSqlMap.QueryForObject("SomeSelectStatement", param);
<select id="SomeSelectStatement" parameterClass="map" resultMap="UserMap">
SELECT * FROM people where LastName = #DaLastName# AND FirstName =
#DaFirstName#
</select>
Hope that helps, and hope it isn't misguided in any way =)
V/R,
Nicholas Piasecki