private Vote(Transaction transaction, Attachment.MessagingVoteCasting attachment) { this.id = transaction.getId(); this.dbKey = voteDbKeyFactory.newKey(this.id); this.pollId = attachment.getPollId(); this.voterId = transaction.getSenderId(); this.voteBytes = attachment.getPollVote(); }
private Vote(ResultSet rs) throws SQLException { this.id = rs.getLong("id"); this.dbKey = voteDbKeyFactory.newKey(this.id); this.pollId = rs.getLong("poll_id"); this.voterId = rs.getLong("voter_id"); this.voteBytes = rs.getBytes("vote_bytes"); }
static Account addOrGetAccount(long id) { Account account = accountTable.get(accountDbKeyFactory.newKey(id)); if (account == null) { account = new Account(id); accountTable.insert(account); } return account; }
private Asset(ResultSet rs) throws SQLException { this.assetId = rs.getLong("id"); this.dbKey = assetDbKeyFactory.newKey(this.assetId); this.accountId = rs.getLong("account_id"); this.name = rs.getString("name"); this.description = rs.getString("description"); this.quantityQNT = rs.getLong("quantity"); this.decimals = rs.getByte("decimals"); }
private Asset(Transaction transaction, Attachment.ColoredCoinsAssetIssuance attachment) { this.assetId = transaction.getId(); this.dbKey = assetDbKeyFactory.newKey(this.assetId); this.accountId = transaction.getSenderId(); this.name = attachment.getName(); this.description = attachment.getDescription(); this.quantityQNT = attachment.getQuantityQNT(); this.decimals = attachment.getDecimals(); }
private Account(long id) { if (id != Crypto.rsDecode(Crypto.rsEncode(id))) { Logger.logMessage("CRITICAL ERROR: Reed-Solomon encoding fails for " + id); } this.id = id; this.dbKey = accountDbKeyFactory.newKey(this.id); this.creationHeight = Nxt.getBlockchain().getHeight(); currentLeasingHeightFrom = Integer.MAX_VALUE; }
public static Account getAccount(byte[] publicKey) { Account account = accountTable.get(accountDbKeyFactory.newKey(getId(publicKey))); if (account == null) { return null; } if (account.getPublicKey() == null || Arrays.equals(account.getPublicKey(), publicKey)) { return account; } throw new RuntimeException( "DUPLICATE KEY for account " + Convert.toUnsignedLong(account.getId()) + " existing key " + Convert.toHexString(account.getPublicKey()) + " new key " + Convert.toHexString(publicKey)); }
private Account(ResultSet rs) throws SQLException { this.id = rs.getLong("id"); this.dbKey = accountDbKeyFactory.newKey(this.id); this.creationHeight = rs.getInt("creation_height"); this.publicKey = rs.getBytes("public_key"); this.keyHeight = rs.getInt("key_height"); this.balanceNQT = rs.getLong("balance"); this.unconfirmedBalanceNQT = rs.getLong("unconfirmed_balance"); this.forgedBalanceNQT = rs.getLong("forged_balance"); this.name = rs.getString("name"); this.description = rs.getString("description"); this.currentLeasingHeightFrom = rs.getInt("current_leasing_height_from"); this.currentLeasingHeightTo = rs.getInt("current_leasing_height_to"); this.currentLesseeId = rs.getLong("current_lessee_id"); this.nextLeasingHeightFrom = rs.getInt("next_leasing_height_from"); this.nextLeasingHeightTo = rs.getInt("next_leasing_height_to"); this.nextLesseeId = rs.getLong("next_lessee_id"); }
public static Vote getVote(long id) { return voteTable.get(voteDbKeyFactory.newKey(id)); }
public static Asset getAsset(long id) { return assetTable.get(assetDbKeyFactory.newKey(id)); }
public static RewardRecipientAssignment getRewardRecipientAssignment(Long id) { return rewardRecipientAssignmentTable.get(rewardRecipientAssignmentDbKeyFactory.newKey(id)); }
public static Account getAccount(long id, int height) { return id == 0 ? null : accountTable.get(accountDbKeyFactory.newKey(id), height); }