Coming from NHibernate, I've tried to do something like this in Java (first example):
http://ayende.com/Blog/archive/2009/06/03/nhibernate-mapping-ndash-ltmapgt.aspx
I have the following code:
public class Box implements Serializable {
private Long boxId;
private Map<String, String> properties;
public String getProperty(String key) {
return properties.get(key);
}
}
And in the mapping:
<map name="properties" access="field">
<key column="boxId"/>
<map-key column="propertyKey" type="string"/>
<element column="propertyValue" type="clob"/>
</map>
But when I try to get a property value through the getProperty method, I get the following error:
java.lang.ClassCastException: $Proxy17 cannot be cast to java.lang.String
Am I overlooking something obvious here? I don't really get what "$Proxy17" is.