Search in sources :

Example 61 with SelectSqlBuilder

use of com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder in project dal by ctripcorp.

the class DaoBySqlBuilder method getAllTasks.

public List<GenTaskBySqlBuilder> getAllTasks() throws SQLException {
    DalHints hints = DalHints.createIfAbsent(null);
    SelectSqlBuilder builder = new SelectSqlBuilder().selectAll();
    List<GenTaskBySqlBuilder> list = client.query(builder, hints);
    processList(list);
    return list;
}
Also used : DalHints(com.ctrip.platform.dal.dao.DalHints) FreeSelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder) SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder) GenTaskBySqlBuilder(com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder)

Example 62 with SelectSqlBuilder

use of com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder in project dal by ctripcorp.

the class TestTableDaoForSetObject method count.

/**
 * Get the all records count
 */
public int count(DalHints hints) throws SQLException {
    hints = DalHints.createIfAbsent(hints);
    SelectSqlBuilder builder = new SelectSqlBuilder().selectCount();
    return client.count(builder, hints).intValue();
}
Also used : SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)

Example 63 with SelectSqlBuilder

use of com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder in project dal by ctripcorp.

the class TestTableDao method queryAll.

/**
 * Get all records from table
 */
public List<TestTable> queryAll(DalHints hints) throws SQLException {
    hints = DalHints.createIfAbsent(hints);
    SelectSqlBuilder builder = new SelectSqlBuilder().selectAll().orderBy("ID", ASC);
    return client.query(builder, hints);
}
Also used : SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)

Example 64 with SelectSqlBuilder

use of com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder in project dal by ctripcorp.

the class TestTableDao method count.

/**
 * Get the all records count
 */
public int count(DalHints hints) throws SQLException {
    hints = DalHints.createIfAbsent(hints);
    SelectSqlBuilder builder = new SelectSqlBuilder().selectCount();
    return client.count(builder, hints).intValue();
}
Also used : SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)

Example 65 with SelectSqlBuilder

use of com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder in project dal by ctripcorp.

the class TestTableDao method count.

/**
 * Get the all records count
 */
public int count(DalHints hints) throws SQLException {
    hints = DalHints.createIfAbsent(hints);
    SelectSqlBuilder builder = new SelectSqlBuilder().selectCount();
    return client.count(builder, hints).intValue();
}
Also used : SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)

Aggregations

SelectSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)93 Test (org.junit.Test)71 ArrayList (java.util.ArrayList)35 FreeSelectSqlBuilder (com.ctrip.platform.dal.dao.sqlbuilder.FreeSelectSqlBuilder)28 DalHints (com.ctrip.platform.dal.dao.DalHints)15 SQLException (java.sql.SQLException)15 ClientTestModel (com.ctrip.platform.dal.dao.unitbase.ClientTestModel)5 HashSet (java.util.HashSet)5 DalTableDao (com.ctrip.platform.dal.dao.DalTableDao)4 DalException (com.ctrip.platform.dal.exceptions.DalException)4 StatementParameters (com.ctrip.platform.dal.dao.StatementParameters)3 ClientTestModel (test.com.ctrip.platform.dal.dao.unitbase.ClientTestModel)3 LocalDalPropertiesProvider (com.ctrip.platform.dal.dao.configure.LocalDalPropertiesProvider)1 GenTaskByFreeSql (com.ctrip.platform.dal.daogen.entity.GenTaskByFreeSql)1 GenTaskBySqlBuilder (com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder)1