All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kasinf.framework.rest.repository.callback.SearchCallback Maven / Gradle / Ivy

The newest version!
package com.kasinf.framework.rest.repository.callback;

import com.kasinf.framework.rest.support.Searchable;

import javax.persistence.Query;

/**
 * @author lkhsh
 */
public interface SearchCallback {

    SearchCallback NONE = new NoneSearchCallback();
    SearchCallback DEFAULT = new DefaultSearchCallback();

    /**
     * 动态拼HQL where、group by having
     *
     * @param ql     hql
     * @param search 条件
     */
    default void prepareQl(StringBuilder ql, Searchable search){};

    /**
     * 动态拼装order条件
     *
     * @param ql     ql语句
     * @param search 查询条件
     */
    default void prepareOrder(StringBuilder ql, Searchable search){};

    /**
     * 根据search给query赋值及设置分页信息
     *
     * @param query  hql
     * @param search 条件
     */
    default void setValues(Query query, Searchable search){};

    /**
     * 设置分页信息
     *
     * @param query  查询
     * @param search 查询条件
     */
    default void setPageable(Query query, Searchable search){};
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy