开发者

code for search in CRUD area in playframework

开发者 https://www.devze.com 2023-03-31 18:10 出处:网络
I recently finished the play tutorial..In the CRUD Admin area,there is asearch facility ,where you can search for a keyword in title of Posts.Where do I find the code for that particular function?(sea

I recently finished the play tutorial..In the CRUD Admin area,there is a search facility ,where you can search for a keyword in title of Posts.Where do I find the code for that particular function?(search).I went thru the CRUD module code ,but could not find 开发者_运维问答it.Can someone help?


The search here?

code for search in CRUD area in playframework

The relevant part of the code is (in CRUD.java [see modules/crud/app/controller in your play install dir.]):

@SuppressWarnings("unchecked")
public List<Model> findPage(int page, String search, String searchFields, 
    String orderBy, String order, String where) 
{
    return Model.Manager.factoryFor(entityClass).fetch((page - 1) * getPageSize(),
        getPageSize(), orderBy, order, searchFields == null ? 
        new ArrayList<String>() : Arrays.asList(searchFields.split("[ ]")), 
        search, where);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消