long id = ((Long)data.get(Comment.COMMENT_ID)).longValue();
HashMap res = new HashMap();
String tmp;
statement.setLong(COMMENT_ID, id);
results = statement.executeQuery();
if( !results.next() ) {
throw new PersistenceException("No such comment: " + id);
}
tmp = results.getString(APPROVED);
res.put(Comment.APPROVED,
new Boolean(tmp.trim().equalsIgnoreCase("Y")));
tmp = results.getString(EMAIL);
if( results.wasNull() ) {
res.put(Comment.EMAIL, null);
}
else {
res.put(Comment.EMAIL, tmp.trim());
}
res.put(Comment.NAME, results.getString(NAME));
res.put(Comment.COMMENT, results.getString(COMMENT));
res.put(Comment.CREATED, results.getDate(CREATED));
return res;