• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DbClause类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: notify

import nxt.db.DbClause; //导入依赖的package包/类
@Override
public void notify(Block block) {
    if (block.getHeight() <= Constants.MONETARY_SYSTEM_BLOCK) {
        return;
    }
    try (DbIterator<Currency> issuedCurrencies = currencyTable.getManyBy(new DbClause.IntClause("issuance_height", block.getHeight()), 0, -1)) {
        for (Currency currency : issuedCurrencies) {
            if (currency.getCurrentReservePerUnitNQT() < currency.getMinReservePerUnitNQT()) {
                listeners.notify(currency, Event.BEFORE_UNDO_CROWDFUNDING);
                undoCrowdFunding(currency);
            } else {
                listeners.notify(currency, Event.BEFORE_DISTRIBUTE_CROWDFUNDING);
                distributeCurrency(currency);
            }
        }
    }
}
 
开发者ID:Ziftr,项目名称:nxt,代码行数:18,代码来源:Currency.java


示例2: getVoters

import nxt.db.DbClause; //导入依赖的package包/类
public static Map<Long,Long> getVoters(Poll poll) {
    Map<Long,Long> map = new HashMap<>();
    try (DbIterator<Vote> voteIterator = voteTable.getManyBy(new DbClause.LongClause("poll_id", poll.getId()), 0, -1)) {
        while (voteIterator.hasNext()) {
            Vote vote = voteIterator.next();
            map.put(vote.getVoterId(), vote.getId());
        }
    }
    return map;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:Vote.java


示例3: getAskOrdersByAccountAsset

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Ask> getAskOrdersByAccountAsset(final long accountId, final long assetId, int from, int to) {
    DbClause dbClause = new DbClause(" account_id = ? AND asset_id = ? ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, accountId);
            pstmt.setLong(index++, assetId);
            return index;
        }
    };
    return askOrderTable.getManyBy(dbClause, from, to);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:12,代码来源:Order.java


示例4: getBidOrdersByAccountAsset

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Bid> getBidOrdersByAccountAsset(final long accountId, final long assetId, int from, int to) {
    DbClause dbClause = new DbClause(" account_id = ? AND asset_id = ? ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, accountId);
            pstmt.setLong(index++, assetId);
            return index;
        }
    };
    return bidOrderTable.getManyBy(dbClause, from, to);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:12,代码来源:Order.java


示例5: getEscrowParticipentClause

import nxt.db.DbClause; //导入依赖的package包/类
private static DbClause getEscrowParticipentClause(final long accountId) {
	return new DbClause(" (sender_id = ? OR recipient_id = ?) ") {
		@Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, accountId);
            pstmt.setLong(index++, accountId);
            return index;
        }
	};
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:Escrow.java


示例6: getEscrowTransactionsByParticipent

import nxt.db.DbClause; //导入依赖的package包/类
public static Collection<Escrow> getEscrowTransactionsByParticipent(Long accountId) {
	List<Escrow> filtered = new ArrayList<>();
	DbIterator<Decision> it = decisionTable.getManyBy(new DbClause.LongClause("account_id", accountId), 0, -1);
	while(it.hasNext()) {
		Decision decision = it.next();
		Escrow escrow = escrowTable.get(escrowDbKeyFactory.newKey(decision.escrowId));
		if(escrow != null) {
			filtered.add(escrow);
		}
	}
	return filtered;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:13,代码来源:Escrow.java


示例7: getUpdateOnBlockClause

import nxt.db.DbClause; //导入依赖的package包/类
private static DbClause getUpdateOnBlockClause(final int timestamp) {
	return new DbClause(" deadline < ? ") {
		@Override
		public int set(PreparedStatement pstmt, int index) throws SQLException {
			pstmt.setInt(index++, timestamp);
			return index;
		}
	};
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:10,代码来源:Escrow.java


示例8: getAccountsWithRewardRecipientClause

import nxt.db.DbClause; //导入依赖的package包/类
private static DbClause getAccountsWithRewardRecipientClause(final long id, final int height) {
	return new DbClause(" recip_id = ? AND from_height <= ? ") {
		@Override
		public int set(PreparedStatement pstmt, int index) throws SQLException {
			pstmt.setLong(index++, id);
			pstmt.setInt(index++, height);
			return index;
		}
	};
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:Account.java


示例9: getGoodsInStock

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Goods> getGoodsInStock(int from, int to) {
    DbClause dbClause = new DbClause(" delisted = FALSE AND quantity > 0 ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            return index;
        }
    };
    return Goods.goodsTable.getManyBy(dbClause, from, to);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:10,代码来源:DigitalGoodsStore.java


示例10: getSellerGoods

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Goods> getSellerGoods(final long sellerId, final boolean inStockOnly, int from, int to) {
    DbClause dbClause = new DbClause(" seller_id = ? " + (inStockOnly ? "AND delisted = FALSE AND quantity > 0" : "")) {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, sellerId);
            return index;
        }
    };
    return Goods.goodsTable.getManyBy(dbClause, from, to, " ORDER BY name ASC, timestamp DESC, id ASC ");
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:DigitalGoodsStore.java


示例11: getSellerBuyerPurchases

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Purchase> getSellerBuyerPurchases(final long sellerId, final long buyerId, int from, int to) {
    DbClause dbClause = new DbClause(" seller_id = ? AND buyer_id = ? ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, sellerId);
            pstmt.setLong(index++, buyerId);
            return index;
        }
    };
    return Purchase.purchaseTable.getManyBy(dbClause, from, to);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:12,代码来源:DigitalGoodsStore.java


示例12: getPendingSellerPurchases

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Purchase> getPendingSellerPurchases(final long sellerId, int from, int to) {
    DbClause dbClause = new DbClause(" seller_id = ? AND pending = TRUE ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, sellerId);
            return index;
        }
    };
    return Purchase.purchaseTable.getManyBy(dbClause, from, to);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:DigitalGoodsStore.java


示例13: getExpiredPendingPurchases

import nxt.db.DbClause; //导入依赖的package包/类
private static DbIterator<Purchase> getExpiredPendingPurchases(final int timestamp) {
       DbClause dbClause = new DbClause(" deadline < ? AND pending = TRUE ") {
           @Override
           public int set(PreparedStatement pstmt, int index) throws SQLException {
               pstmt.setLong(index++, timestamp);
               return index;
           }
       };
       return Purchase.purchaseTable.getManyBy(dbClause, 0, -1);
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:DigitalGoodsStore.java


示例14: getByParticipantClause

import nxt.db.DbClause; //导入依赖的package包/类
private static DbClause getByParticipantClause(final long id) {
	return new DbClause(" (sender_id = ? OR recipient_id = ?) ") {
		@Override
		public int set(PreparedStatement pstmt, int index) throws SQLException {
			pstmt.setLong(index++, id);
			pstmt.setLong(index++, id);
			return index;
		}
	};
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:11,代码来源:Subscription.java


示例15: getUpdateOnBlockClause

import nxt.db.DbClause; //导入依赖的package包/类
private static DbClause getUpdateOnBlockClause(final int timestamp) {
	return new DbClause(" time_next <= ? ") {
		@Override
		public int set(PreparedStatement pstmt, int index) throws SQLException {
			pstmt.setInt(index++, timestamp);
			return index;
		}
	};
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:10,代码来源:Subscription.java


示例16: getPollsByAccount

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Poll> getPollsByAccount(long accountId, boolean includeFinished, int from, int to) {
    DbClause dbClause = new DbClause.LongClause("account_id", accountId);
    if (!includeFinished) {
        dbClause = dbClause.and(new DbClause.IntClause("finish_height", DbClause.Op.GT, Nxt.getBlockchain().getHeight()));
    }
    return pollTable.getManyBy(dbClause, from, to);
}
 
开发者ID:BitcoinFullnode,项目名称:ROKOS-OK-Bitcoin-Fullnode,代码行数:8,代码来源:Poll.java


示例17: deleteCurrency

import nxt.db.DbClause; //导入依赖的package包/类
static void deleteCurrency(Currency currency) {
    List<CurrencyMint> currencyMints = new ArrayList<>();
    try (DbIterator<CurrencyMint> mints = currencyMintTable.getManyBy(new DbClause.LongClause("currency_id", currency.getId()), 0, -1)) {
        while (mints.hasNext()) {
            currencyMints.add(mints.next());
        }
    }
    for (CurrencyMint mint : currencyMints) {
        currencyMintTable.delete(mint);
    }
}
 
开发者ID:giannisKonst,项目名称:blockchain,代码行数:12,代码来源:CurrencyMint.java


示例18: getOffers

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<CurrencyBuyOffer> getOffers(Currency currency, boolean availableOnly, int from, int to) {
    DbClause dbClause = new DbClause.LongClause("currency_id", currency.getId());
    if (availableOnly) {
        dbClause = dbClause.and(availableOnlyDbClause);
    }
    return buyOfferTable.getManyBy(dbClause, from, to, " ORDER BY rate DESC, creation_height ASC, transaction_index ASC ");
}
 
开发者ID:giannisKonst,项目名称:blockchain,代码行数:8,代码来源:CurrencyBuyOffer.java


示例19: getGoodsPurchases

import nxt.db.DbClause; //导入依赖的package包/类
public static DbIterator<Purchase> getGoodsPurchases(long goodsId, long buyerId, boolean withPublicFeedbacksOnly, boolean completedOnly, int from, int to) {
    DbClause clause = new LongPurchasesClause("goods_id", goodsId, withPublicFeedbacksOnly, completedOnly);
    if (buyerId != 0) {
        clause = clause.and(new DbClause.LongClause("buyer_id", buyerId));
    }
    return purchaseTable.getManyBy(clause, from, to);
}
 
开发者ID:BitcoinFullnode,项目名称:ROKOS-OK-Bitcoin-Fullnode,代码行数:8,代码来源:DigitalGoodsStore.java


示例20: getLessorsClause

import nxt.db.DbClause; //导入依赖的package包/类
private DbClause getLessorsClause(final int height) {
    return new DbClause(" current_lessee_id = ? AND current_leasing_height_from <= ? AND current_leasing_height_to > ? ") {
        @Override
        public int set(PreparedStatement pstmt, int index) throws SQLException {
            pstmt.setLong(index++, getId());
            pstmt.setInt(index++, height);
            pstmt.setInt(index++, height);
            return index;
        }
    };
}
 
开发者ID:Ziftr,项目名称:nxt,代码行数:12,代码来源:Account.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AggregateRowsMeta类代码示例发布时间:2022-05-22
下一篇:
Java DataSourceDefinitions类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap