Java Code Examples for io.jboot.db.model.Columns#isEmpty()

The following examples show how to use io.jboot.db.model.Columns#isEmpty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlUtils.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static String toWhereSql(Columns columns) {
    if (columns == null || columns.isEmpty()){
        return "";
    }

    StringBuilder sql = new StringBuilder();
    SqlBuilder.buildWhereSql(sql,columns.getList(),' ');
    return sql.toString();
}
 
Example 2
Source File: JbootDbPro.java    From jboot with Apache License 2.0 4 votes vote down vote up
public List<Record> find(String tableName, Columns columns, String orderBy, Object limit) {
    JbootDialect dialect = (JbootDialect) getConfig().getDialect();
    String sql = dialect.forFindByColumns(null, tableName, "*", columns.getList(), orderBy, limit);
    return columns.isEmpty() ? find(sql) : find(sql, columns.getValueArray());
}
 
Example 3
Source File: JbootDbPro.java    From jboot with Apache License 2.0 4 votes vote down vote up
public int delete(String tableName, Columns columns) {
    JbootDialect dialect = (JbootDialect) getConfig().getDialect();
    String sql = dialect.forDeleteByColumns(null, tableName, columns.getList());
    return columns.isEmpty() ? delete(sql) : delete(sql, columns.getValueArray());
}