java - Play Framework : Sorting crud table fields

标签 java playframework

如何将排序顺序设置为默认的 DESC?这种排序除了使 postedAt 成为唯一可排序的项目外什么都不做:

<div id="crudListTable">
    #{crud.table fields:['title', 'postedAt'], sort:['postedAt']}
        #{crud.custom 'postedAt'}
            ${object.postedAt.format("dd-MM-yyyy")}
        #{/crud.custom}
    #{/crud.table}
</div>

最佳答案

如果需要,您可以在实体上执行此操作:

@Entity 
public class Course {
   ...
   @ManyToMany
   @OrderBy("lastname ASC")
   public List<Student> students;
   ...
}

关于java - Play Framework : Sorting crud table fields,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7512709/

相关文章:

playframework - 部署 Play!框架应用

java RESTful webservice + DAO + JDBC 最佳实践

java - 在 Excel 上书写

java - HttpConnection - javax.microedition,为 getLength() 方法返回 -1

java - 更改用户在 Facebook 上的显示名称

scala - 扩展 Play SBT "run"任务

java - 如何使用 docx4j 阅读 word 文档并获取所有样式的部分内容

java - JAXB "nor any of its super class is known to this context"避免@XmlSeeAlso

playframework - 在 playframework 项目中使用 scalatest

scala - Play Framework 2.0 和 Selenium 入门