Here's some code to get you started along that treachorous path... =)
Code:
public void setMetricsMap(Map<String, String[]> deepMap) {
Map<String,String> map = new HashMap<String,String>();
Iterator<String> it = deepMap.keySet().iterator();
String key;
while(it.hasNext()) {
key = it.next();
map.put(key,StringUtils.join(deepMap.get(key), '|'));
}
this.setFlatMetricsMap(map);
}
public Map<String, String[]> getMetricsMap() {
Map<String,String> flatMap = this.getFlatMetricsMap();
Map<String,String[]> map = new HashMap<String, String[]>();
Iterator<String> it = flatMap.keySet().iterator();
String key;
while(it.hasNext()) {
key = it.next();
map.put(key,StringUtils.split(flatMap.get(key), '|'));
}
return map;
}
Then map the field flatMetricsMap in your Hibernate code and call the metricsMap field in your Java code.
Have fun!