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

com.obatis.orm.sql.mysql.HandleOrderMethod Maven / Gradle / Ivy

The newest version!
package com.obatis.orm.sql.mysql;

import com.obatis.orm.constant.type.OrderEnum;
import com.obatis.orm.constant.type.SqlHandleEnum;
import com.obatis.orm.provider.condition.handle.AbstractOrder;

import java.util.List;

/**
 * mysql 数据库排序实现
 * @author HuangLongPu
 */
public class HandleOrderMethod extends AbstractOrder {

	/**
	 * 实现 mysql 排序的 sql 语句构建
	 * @param orders
	 * @param orderName
	 * @param orderType
	 */
	@Override
	protected void addOrder(List orders, String orderName, OrderEnum orderType, SqlHandleEnum sqlHandleEnum) {
		Object[] order = {orderName, (OrderEnum.ORDER_ASC.equals(orderType) ? "asc" : "desc"), sqlHandleEnum};
		orders.add(order);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy