com.rt.orm.jdbc.JdbcParam Maven / Gradle / Ivy
package com.rt.orm.jdbc;
import com.json.JSONObject;
import com.rt.core.constant.RTConst;
import java.io.Serializable;
public class JdbcParam extends JSONObject {
/**
* 快速生成 id 类的参数
*
* @param id id
* @return JdbcParam
*/
public static JdbcParam newIdParam(Serializable id) {
return JdbcParam.newBuilder()
.withParam(RTConst.ID, id)
.build();
}
public static JdbcParamBuilder newBuilder() {
return new JdbcParamBuilder();
}
static class JdbcParamBuilder {
private JdbcParam params = new JdbcParam();
public JdbcParamBuilder() {
}
public JdbcParam build() {
return params;
}
public JdbcParamBuilder withParam(String key, Serializable value) {
params.put(key, value);
return this;
}
}
}