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

com.bixuebihui.db.SqlPocket Maven / Gradle / Ivy

Go to download

a fast small database connection pool and a active record flavor mini framework

There is a newer version: 1.15.3.3
Show newest version
package com.bixuebihui.db;

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

/**
 * 

SqlPocket class.

* * @author xingwx * @version $Id: $Id */ public class SqlPocket { private final StringBuffer condition; private final List params; /** *

Constructor for SqlPocket.

*/ public SqlPocket() { condition = new StringBuffer(); params = new ArrayList<>(); } /** *

addFilter.

* * @param fragment a {@link java.lang.String} object. * @param param a {@link java.lang.Object} object. * @return a {@link SqlPocket} object. */ public SqlPocket addFilter(String fragment, Object param) { condition.append(fragment); if (param instanceof Collection) { params.addAll((Collection) param); } else { params.add(param); } return this; } /** *

Getter for the field condition.

* * @return a {@link java.lang.StringBuffer} object. */ public StringBuffer getCondition() { return condition; } /** *

Getter for the field params.

* * @return a {@link java.util.List} object. */ public List getParams() { return params; } }