Spring mvc 带有ORDERBY子句的Spring类型查询查找器

Spring mvc 带有ORDERBY子句的Spring类型查询查找器,spring-mvc,hql,Spring Mvc,Hql,使用SpringMVC3.0和roo,我试图编写一个带有ORDERBY子句的自定义typequery查找程序 这就是我到目前为止所做的 public static TypedQuery<tt.edu.sbcs.model.SessionInfo> findAllSessionInfosByScheduleOrderByDisplayOrder(Schedule schedule) { if (schedule == null) throw new IllegalArgume

使用SpringMVC3.0和roo,我试图编写一个带有ORDERBY子句的自定义typequery查找程序

这就是我到目前为止所做的

 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;
}
public静态类型查询findAllSessionInfosByScheduleOrderByDisplayOrder(日程安排){
如果(schedule==null)抛出新的IllegalArgumentException(“schedule参数是必需的”);
EntityManager si=SessionInfo.EntityManager();
TypedQuery q=si.createQuery(“从SessionInfo中选择o作为o,其中o.schedule=:按o.displayOrder ASC调度订单”,SessionInfo.class);
q、 设置参数(“计划”,计划);
返回q;
}

我不确定我的查询是否错误,但对于此查询,我返回了一个错误。任何帮助都将不胜感激。

这句话是错误的:

"SELECT o FROM SessionInfo As o WHERE o.schedule = :schedule ORDER BY o.displayOrder ASC"
       ===
您正在选择与表别名相同的列名。
您需要一个列列表,或者*用于所有列