ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shankman, Gordon L." <gordon.shank...@ngc.com>
Subject Accessing values stored in a map bean property.
Date Tue, 01 Feb 2005 19:43:37 GMT
Is it possible to access key/value pairs of a map bean property through iBATIS?  I am trying
a configuration similar to the one below, but get a message saying java.util.HashMap does
not have a property named "key1."  Do I need to refactor my object, or is there a solution
I'm just missing?
 
Thanks,
Gordon Shankman
 
BeanWithMap.java:
public class BeanWithMap {
...
private HashMap mapProperty;
 
public HashMap getMapProperty() {}
public void setMapProperty(HashMap map) {}
...
}
 
BeanWithMap.xml:
<update id="" parameterClass="BeanWithMap">
...
<ifNotNull property="mapProperty.key1">
do something
</ifNotNull>
 
<ifNotNull property="mapProperty.key2">
do something else
</ifNotNull
...
</update>
 
Gordon Shankman
Software Engineer
Northrop Grumman Information Technology - TASC
4805 Stonecroft Blvd.
Chantily, VA  20151
(703) 633-8300 x8670
 

Mime
View raw message