public Boolean isStale(AttendanceClinicalNotesRefVo attendanceClinicalNoteRef) { if(attendanceClinicalNoteRef == null) return false; DomainFactory factory = getDomainFactory(); List<?> appts = factory.find("select a.id from AttendanceClinicalNotes as a where a.id = :attClinNoteId and a.version > :attClinNoteVersion", new String[] {"attClinNoteId", "attClinNoteVersion"}, new Object[] {attendanceClinicalNoteRef.getID_AttendanceClinicalNotes(), attendanceClinicalNoteRef.getVersion_AttendanceClinicalNotes()}); if(appts != null && appts.size() > 0) return true; return false; }