public List<Meeting> getRecentlyMeetingsByAudit(Long candidateId, Long ownerId) {
List<Meeting> meetings = new ArrayList<Meeting>();
meetings = mgr.createQuery("select new com.integral7.ejb3.investigations.Meeting(m.id, m.scheduledDate, m.type.name, m.description, " +
"
case when exists(select id from MeetingAudit ma where ma.meeting = m and ma.audit.id = ?0) then True else False end) " +
" from Meeting m " +
" where m.owner.id = ?1 and m.scheduledDate >= ?2 order by m.scheduledDate asc")
.setParameter(0, candidateId)
.setParameter(1, ownerId)
.setParameter(2, DateUtils.convertToBeginningOfDay(new Date())).getResultList();
return meetings;
}
这里主要注意
True 和
False 首字母必须大写其余小写.
posted on 2008-08-29 23:38
周锐 阅读(798)
评论(0) 编辑 收藏 所属分类:
EJB 、
Hibernate 、
SQL Server