Search in sources :

Example 91 with SelectSqlBuilder

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

the class ChildwithallfieldsDao method queryAll.

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

Example 92 with SelectSqlBuilder

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

the class ChildwithallfieldsDao method queryAllByPage.

/**
 * Query ChildWithAllFields with paging function The pageSize and pageNo must be greater than zero.
 */
public List<ChildWithAllFields> queryAllByPage(int pageNo, int pageSize, DalHints hints) throws SQLException {
    hints = DalHints.createIfAbsent(hints);
    SelectSqlBuilder builder = new SelectSqlBuilder();
    builder.selectAll().atPage(pageNo, pageSize).orderBy("grandParentId", ASC);
    return client.query(builder, hints);
}
Also used : SelectSqlBuilder(com.ctrip.platform.dal.dao.sqlbuilder.SelectSqlBuilder)

Example 93 with SelectSqlBuilder

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

the class ChildwithallfieldsDao 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