Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ActiveRecord有诸如Entity.first, Entity.last, Entity.first.nextetc 之类的方法(注意没有传递参数)。
ActiveRecord
Entity.first, Entity.last, Entity.first.next
activejdbc 中是否有类似的构造?
有“第一”:http: //javalite.github.io/activejdbc/org/javalite/activejdbc/Model.html#first-java.lang.String-java.lang.Object...-
,但不是其他人。
你可以这样做:
User.findAll().orderBy("age").limit(1); //--> first User.findAll().orderBy("age desc").limit(1); //--> last
这种你控制的方式是返回的。