}
@Override
public Rating getRating(IRatingSearchBean searchBean){
Rating rating = null;
PreparedStatement stat = null;
ResultSet res = null;
Connection conn = null;
try {
conn = this.getConnection();
String query = this.createQueryString(searchBean);
stat = conn.prepareStatement(query);
this.buildStatement(searchBean, stat);
res = stat.executeQuery();
if (res.next()) {
rating = new Rating();
rating.setId(res.getInt("id"));
rating.setCommentId(res.getInt("commentid"));
rating.setContentId(res.getString("contentid"));
rating.setVote(res.getInt("voters"), res.getInt("sumvote"));
}
} catch (Throwable t) {
processDaoException(t, "Errore while search rating", "getRating");
} finally {
closeDaoResources(res, stat, conn);