本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}