Search in sources :

Example 1 with SQLReady

use of org.beetl.sql.core.SQLReady in project act-eagle-allone by mailtous.

the class BeetlSqlDao method count.

@Override
public Long count(String sql, Object... args) {
    List<Long> countList = sqlm.execute(new SQLReady(sql, args), Long.class);
    Long count = C.isEmpty(countList) ? new Long(0) : countList.get(0);
    return count;
}
Also used : SQLReady(org.beetl.sql.core.SQLReady)

Example 2 with SQLReady

use of org.beetl.sql.core.SQLReady in project act-eagle-allone by mailtous.

the class BeetlSqlDao method getPage.

@Override
public Page<T> getPage(Class<T> clz, Page page, String frameSql, Object[] args) {
    PageQuery<T> pq = page.myPageToPageQuery(page, new PageQuery());
    SQLReady sqlReady = new SQLReady(frameSql, args);
    pq = sqlm.execute(sqlReady, clz, pq);
    return page.pageQueryToMyPage(pq, page);
}
Also used : PageQuery(org.beetl.sql.core.engine.PageQuery) SQLReady(org.beetl.sql.core.SQLReady)

Example 3 with SQLReady

use of org.beetl.sql.core.SQLReady in project act-eagle-allone by mailtous.

the class BeetlSqlDao method getPage.

@Override
public Page<T> getPage(Page page, String frameSql, Object[] args) {
    PageQuery<T> pq = page.myPageToPageQuery(page, new PageQuery());
    SQLReady sqlReady = new SQLReady(frameSql, args);
    pq = sqlm.execute(sqlReady, this.persistentClass, pq);
    return page.pageQueryToMyPage(pq, page);
}
Also used : PageQuery(org.beetl.sql.core.engine.PageQuery) SQLReady(org.beetl.sql.core.SQLReady)

Example 4 with SQLReady

use of org.beetl.sql.core.SQLReady in project act-eagle-allone by mailtous.

the class Qe method toPage.

/**
 * 返回 PAGE 查询结果集
 * 注意不要传入 limit 语句
 * @param clz  返回的class
 * @param page
 * @param <CLZ>
 * @return
 */
public <CLZ> Page<CLZ> toPage(Class<CLZ> clz, Page page) {
    PageQuery<CLZ> pq = page.myPageToPageQuery(page, new PageQuery());
    pq = sqlManager.execute(new SQLReady(build()), clz, pq);
    return page.pageQueryToMyPage(pq, page);
}
Also used : PageQuery(org.beetl.sql.core.engine.PageQuery) SQLReady(org.beetl.sql.core.SQLReady)

Example 5 with SQLReady

use of org.beetl.sql.core.SQLReady in project act-eagle-allone by mailtous.

the class SysPermissionDao method realDelByFuncId.

public boolean realDelByFuncId(Long func_id) {
    // String sql = " delete from sys_permission where func_id = ?";
    String sql = Qe.del(table).where(new Qe().eq(funcId, func_id)).build();
    super.sqlm.executeUpdate(new SQLReady(sql, new Object[] { funcId }));
    return true;
}
Also used : Qe(com.artlongs.framework.utils.Qe) SQLReady(org.beetl.sql.core.SQLReady)

Aggregations

SQLReady (org.beetl.sql.core.SQLReady)5 PageQuery (org.beetl.sql.core.engine.PageQuery)3 Qe (com.artlongs.framework.utils.Qe)1