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

org.jleopard.session.sessionFactory.ArraysHelper Maven / Gradle / Ivy

Go to download

This is a lightweight complete ORM framework, which encapsulates a large number of commonly used SQL and implements multi-table Association query and paging query.

There is a newer version: 2.2.2
Show newest version
package org.jleopard.session.sessionFactory;



import java.util.ArrayList;
import java.util.List;

import org.jleopard.logging.log.Log;
import org.jleopard.logging.log.LogFactory;
import org.jleopard.util.ArrayUtil;


/**
 * Copyright (c) 2018, Chen_9g 陈刚 ([email protected]).
 * 

* DateTime 2018/4/8 *

* A novice on the road, please give me a suggestion. * 众里寻他千百度,蓦然回首,那人却在,灯火阑珊处。 * Find a way for success and not make excuses for failure. * * 辅助类 判断获取值并拼接sql... */ final class ArraysHelper { private static final Log LOG=LogFactory.getLog(SessionDirectImpl.class); public static String getSql(Object[] values){ if (ArrayUtil.isEmpty(values)){ LOG.error(" 没有带参数..."); } StringBuilder SQL=new StringBuilder(); String sql; if (values.length > 1) { SQL.append("in").append("("); for (int i = 0; i < values.length; ++i) { SQL.append("?").append(","); } SQL.deleteCharAt(SQL.length() - 1).append(")"); sql = SQL.toString(); /*for (int i = 0; i < values.length; ++i) { pstm.setObject(i + 1, values[i]); }*/ } else { SQL.append("=").append("?"); sql = SQL.toString(); } return sql; } public static List toUpperCase(List list){ List ls=new ArrayList(); for (String obj:list){ ls.add(obj.toUpperCase()); } return ls; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy