query.setString("resname", getOLATResourceable()
.getResourceableTypeName());
query.setLong("resId", getOLATResourceable().getResourceableId());
query.setCacheable(true);
//
List results = query.list();
Double average = (Double) query.list().get(0);
// When no ratings are found, a null value is returned!
if (average == null) return Float.valueOf(0);
else return average.floatValue();
}