当前位置: 首页>>代码示例>>Java>>正文


Java LiteQuery类代码示例

本文整理汇总了Java中org.lpw.tephra.dao.orm.lite.LiteQuery的典型用法代码示例。如果您正苦于以下问题:Java LiteQuery类的具体用法?Java LiteQuery怎么用?Java LiteQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LiteQuery类属于org.lpw.tephra.dao.orm.lite包,在下文中一共展示了LiteQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<TransferModel> query(String type, String appId, String user, String orderNo, String billNo, String tradeNo, int state, Timestamp start, Timestamp end, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    append(where, args, "c_start", ">=", start);
    append(where, args, "c_start", "<=", end);
    append(where, args, "c_type", "=", type);
    append(where, args, "c_app_id", "=", appId);
    append(where, args, "c_user", "=", user);
    append(where, args, "c_order_no", "=", orderNo);
    append(where, args, "c_bill_no", "=", billNo);
    append(where, args, "c_trade_no", "=", tradeNo);
    if (state > -1)
        append(where, args, "c_state", "=", state);

    return liteOrm.query(new LiteQuery(TransferModel.class).where(where.toString()).order("c_start desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:18,代码来源:TransferDaoImpl.java

示例2: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<CommentModel> query(Audit audit, String owner, String author, Timestamp start, Timestamp end, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder(Recycle.No.getSql()).append(" and ").append(audit.getSql());
    List<Object> args = new ArrayList<>();
    if (start != null) {
        where.append(" and c_time>=?");
        args.add(start);
    }
    if (end != null) {
        where.append(" and c_time<=?");
        args.add(end);
    }
    if (!validator.isEmpty(owner)) {
        where.append(" and c_owner=?");
        args.add(owner);
    }
    if (!validator.isEmpty(author)) {
        where.append(" and c_author=?");
        args.add(author);
    }

    return liteOrm.query(new LiteQuery(CommentModel.class).where(where.toString()).order("c_time desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:24,代码来源:CommentDaoImpl.java

示例3: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<PaymentModel> query(String type, String appId, String user, String orderNo, String billNo, String tradeNo, int state, Timestamp start, Timestamp end, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    append(where, args, "c_start", ">=", start);
    append(where, args, "c_start", "<=", end);
    append(where, args, "c_type", "=", type);
    append(where, args, "c_app_id", "=", appId);
    append(where, args, "c_user", "=", user);
    append(where, args, "c_order_no", "=", orderNo);
    append(where, args, "c_bill_no", "=", billNo);
    append(where, args, "c_trade_no", "=", tradeNo);
    if (state > -1)
        append(where, args, "c_state", "=", state);

    return liteOrm.query(new LiteQuery(PaymentModel.class).where(where.toString()).order("c_start desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:18,代码来源:PaymentDaoImpl.java

示例4: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<UserModel> query(String user, Timestamp start, Timestamp end, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    where.append("c_user=?");
    args.add(user);
    if (start != null) {
        where.append(" and c_create>=?");
        args.add(start);
    }
    if (end != null) {
        where.append(" and c_create<=?");
        args.add(end);
    }

    return liteOrm.query(new LiteQuery(UserModel.class).where(where.toString())
            .order("c_create desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:19,代码来源:UserDaoImpl.java

示例5: atomicable

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Test
public void atomicable() {
    Assert.assertEquals(lockHelper.hashCode(), atomicable.hashCode());
    atomicable.fail(null);
    atomicable.close();

    String id = lockHelper.lock("key", 10, 20);
    Assert.assertNull(lockHelper.lock("key", 10, 20));
    PageList<LockModel> pl = liteOrm.query(new LiteQuery(LockModel.class), null);
    Assert.assertEquals(1, pl.getList().size());
    Assert.assertEquals(id, pl.getList().get(0).getId());
    atomicable.fail(null);
    pl = liteOrm.query(new LiteQuery(LockModel.class), null);
    Assert.assertEquals(0, pl.getList().size());

    id = lockHelper.lock("key", 10, 20);
    Assert.assertNull(lockHelper.lock("key", 10, 20));
    pl = liteOrm.query(new LiteQuery(LockModel.class), null);
    Assert.assertEquals(1, pl.getList().size());
    Assert.assertEquals(id, pl.getList().get(0).getId());
    atomicable.close();
    pl = liteOrm.query(new LiteQuery(LockModel.class), null);
    Assert.assertEquals(0, pl.getList().size());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:25,代码来源:LockHelperTest.java

示例6: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<ClassifyModel> query(String code, String key, String value, String name, int pageSize, int pageNum) {
    StringBuilder sql = new StringBuilder().append(Recycle.No.getSql()).append(" and c_code like ?");
    List<Object> args = new ArrayList<>();
    args.add(dataSource.getDialect(null).getLike(code, false, true));
    if (!validator.isEmpty(key)) {
        sql.append(" and c_key like ?");
        args.add(dataSource.getDialect(null).getLike(key, true, true));
    }
    if (!validator.isEmpty(value)) {
        sql.append(" and c_value like ?");
        args.add(dataSource.getDialect(null).getLike(value, true, true));
    }
    if (!validator.isEmpty(name)) {
        sql.append(" and c_name like ?");
        args.add(dataSource.getDialect(null).getLike(name, true, true));
    }

    return liteOrm.query(new LiteQuery(ClassifyModel.class).where(sql.toString()).order("c_code").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:21,代码来源:ClassifyDaoImpl.java

示例7: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<PushModel> query(String key, String subject, int state, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    if (!validator.isEmpty(key)) {
        where.append("c_key like ?");
        args.add(dataSource.getDialect(null).getLike(key, true, true));
    }
    if (!validator.isEmpty(subject)) {
        if (!args.isEmpty())
            where.append(" and ");
        where.append("c_subject like ?");
        args.add(dataSource.getDialect(null).getLike(subject, true, true));
    }
    if (state > -1) {
        if (!args.isEmpty())
            where.append(" and ");
        where.append("c_state=?");
        args.add(state);
    }

    return liteOrm.query(new LiteQuery(PushModel.class).where(where.toString())
            .order("c_state desc,c_time desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:25,代码来源:PushDaoImpl.java

示例8: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<MessageModel> query(Timestamp time,Timestamp deadline,  String sender, Set<String> receivers) {
    StringBuilder where = new StringBuilder("c_time>=? and c_deadline>=? and (c_sender=? or c_receiver in(?");
    List<Object> args = new ArrayList<>();
    args.add(time);
    args.add(deadline);
    args.add(sender);
    args.add(sender);
    receivers.forEach(receiver -> {
        where.append(",?");
        args.add(receiver);
    });
    where.append("))");

    return liteOrm.query(new LiteQuery(MessageModel.class).where(where.toString()).order("c_time desc"), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:17,代码来源:MessageDaoImpl.java

示例9: execute

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public int execute(String dataSource, String sql, boolean state0) {
    sql = sql.trim();
    if (sql.equals("") || sql.charAt(0) == '-')
        return 0;

    String md5 = digest.md5(dataSource + sql);
    if (hasAutoTable()) {
        if (state0 && liteOrm.findOne(new LiteQuery(AutoModel.class).where("c_md5=? and c_state=?"), new Object[]{md5, 0}) != null) {
            liteOrm.close();

            return 0;
        }

        AutoModel auto = new AutoModel();
        auto.setMd5(md5);
        auto.setDataSource(dataSource);
        auto.setSql(sql);
        auto.setTime(dateTime.now());
        liteOrm.save(auto);
    }

    int n = this.sql.update(dataSource, sql, new Object[0]);
    this.sql.close();

    return n;
}
 
开发者ID:heisedebaise,项目名称:tephra,代码行数:28,代码来源:ExecuterImpl.java

示例10: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<ColumnModel> query(String table, String name) {
    StringBuilder where = new StringBuilder("c_table=?");
    List<Object> args = new ArrayList<>();
    args.add(table);
    if (!validator.isEmpty(name))
        where.append(" and c_name like ").append(dataSource.getDialect(null).getLike(name, true, true));

    return liteOrm.query(new LiteQuery(ColumnModel.class).where(where.toString()).order("c_sort"), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:11,代码来源:ColumnDaoImpl.java

示例11: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<TableModel> query(String schema, String group, String name) {
    StringBuilder where = new StringBuilder("c_schema=?");
    List<Object> args = new ArrayList<>();
    args.add(schema);
    if (!validator.isEmpty(group)) {
        where.append(" and c_group=?");
        args.add(group);
    }
    if (!validator.isEmpty(name))
        where.append(" and c_name like ").append(dataSource.getDialect(null).getLike(name, true, true));

    return liteOrm.query(new LiteQuery(TableModel.class).where(where.toString()).order("c_sort"), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:15,代码来源:TableDaoImpl.java

示例12: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<SchemaModel> query(String group, String key, String type, String ip, String name) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    append(where, args, "group", group, true);
    append(where, args, "key", key, false);
    append(where, args, "type", type, true);
    append(where, args, "ip", ip, false);
    append(where, args, "name", name, false);

    return liteOrm.query(new LiteQuery(SchemaModel.class).where(where.toString()).order("c_sort"), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:13,代码来源:SchemaDaoImpl.java

示例13: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<DocModel> query(String key, String owner, String author, String subject, Audit audit, Recycle recycle, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder().append(recycle.getSql()).append(" and ").append(audit.getSql());
    List<Object> args = new ArrayList<>();
    append(where, args, "key", key);
    append(where, args, "owner", owner);
    append(where, args, "author", author);
    if (!validator.isEmpty(subject)) {
        where.append(" and c_subject like ?");
        args.add(dataSource.getDialect(null).getLike(subject, true, true));
    }

    return liteOrm.query(new LiteQuery(DocModel.class).where(where.toString()).order("c_sort,c_time desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:15,代码来源:DocDaoImpl.java

示例14: query

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Override
public PageList<LoggerModel> query(String key, int state, Timestamp start, Timestamp end, int pageSize, int pageNum) {
    StringBuilder where = new StringBuilder();
    List<Object> args = new ArrayList<>();
    append(where, args, "c_key", key, "=");
    if (state > -1)
        append(where, args, "c_state", state, "=");
    append(where, args, "c_time", start, ">=");
    append(where, args, "c_time", end, "<=");

    return liteOrm.query(new LiteQuery(LoggerModel.class).where(where.toString()).order("c_time desc").size(pageSize).page(pageNum), args.toArray());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:13,代码来源:LoggerDaoImpl.java

示例15: expire

import org.lpw.tephra.dao.orm.lite.LiteQuery; //导入依赖的package包/类
@Test
public void expire() throws Exception {
    Assert.assertNotNull(lockHelper.lock("key", 10 * 1000, 0));
    Assert.assertNotNull(lockHelper.lock("key 2", 10 * 1000, 20));
    Assert.assertNull(lockHelper.lock("key", 1, 0));
    Thread.sleep(6 * 1000);
    Assert.assertNotNull(lockHelper.lock("key", 10 * 1000, 0));
    Thread.sleep(6 * 1000);
    PageList<LockModel> pl = liteOrm.query(new LiteQuery(LockModel.class), null);
    Assert.assertEquals(1, pl.getList().size());
    Assert.assertEquals("key 2", pl.getList().get(0).getKey());
}
 
开发者ID:heisedebaise,项目名称:ranch,代码行数:13,代码来源:LockHelperTest.java


注:本文中的org.lpw.tephra.dao.orm.lite.LiteQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。