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


Java DbClause类代码示例

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


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


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