【发布时间】:2011-11-15 15:27:40
【问题描述】:
使用 Spring MVC 3.0 和 roo,我正在尝试编写一个带有 order by 子句的自定义类型查询查找器。
这是我迄今为止所做的;
public static TypedQuery<tt.edu.sbcs.model.SessionInfo> findAllSessionInfosByScheduleOrderByDisplayOrder(Schedule schedule) {
if (schedule == null) throw new IllegalArgumentException("The schedule argument is required");
EntityManager si = SessionInfo.entityManager();
TypedQuery<SessionInfo> q = si.createQuery("SELECT o FROM SessionInfo As o WHERE o.schedule = :schedule ORDER BY o.displayOrder ASC", SessionInfo.class);
q.setParameter("schedule", schedule);
return q;
}
我不确定我的查询是否错误,但此查询返回错误。任何帮助将不胜感激。
【问题讨论】:
标签: spring-mvc hql