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

com.easy.query.api4j.select.extension.queryable.SQLOrderable1 Maven / Gradle / Ivy

There is a newer version: 2.3.3
Show newest version
package com.easy.query.api4j.select.extension.queryable;

import com.easy.query.api4j.select.Queryable;
import com.easy.query.api4j.sql.SQLColumnSelector;
import com.easy.query.api4j.sql.SQLOrderBySelector;
import com.easy.query.core.api.dynamic.sort.ObjectSort;
import com.easy.query.core.exception.EasyQueryOrderByInvalidOperationException;
import com.easy.query.core.expression.lambda.SQLExpression1;

/**
 * create time 2023/8/16 08:50
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLOrderable1 {

    default Queryable orderByAsc(SQLExpression1> selectExpression) {
        return orderByAsc(true, selectExpression);
    }

    default Queryable orderByAsc(boolean condition, SQLExpression1> selectExpression) {
        return orderBy(condition, selectExpression, true);
    }

    default Queryable orderByDesc(SQLExpression1> selectExpression) {
        return orderByDesc(true, selectExpression);
    }

    default Queryable orderByDesc(boolean condition, SQLExpression1> selectExpression) {
        return orderBy(condition, selectExpression, false);
    }

    default Queryable orderBy(SQLExpression1> selectExpression, boolean asc) {
        return orderBy(true, selectExpression, asc);
    }

    Queryable orderBy(boolean condition, SQLExpression1> selectExpression, boolean asc);

    /**
     * @param configuration
     * @return
     * @throws EasyQueryOrderByInvalidOperationException 当配置{@link ObjectSort} 为{@code  DynamicModeEnum.STRICT}排序设置的属性不存在当前排序对象里面或者当前查询对象无法获取 {@link SQLColumnSelector}
     */
    default Queryable orderByObject(ObjectSort configuration) {
        return orderByObject(true, configuration);
    }

    /**
     * @param condition
     * @param configuration
     * @return
     * @throws EasyQueryOrderByInvalidOperationException 当配置{@link ObjectSort} 为{@code  DynamicModeEnum.STRICT}排序设置的属性不存在当前排序对象里面或者当前查询对象无法获取 {@link SQLColumnSelector}
     */
    Queryable orderByObject(boolean condition, ObjectSort configuration);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy