Ejemplo n.º 1
0
 static Vote addVote(Transaction transaction, Attachment.MessagingVoteCasting attachment) {
   Vote vote = new Vote(transaction, attachment);
   voteTable.insert(vote);
   return vote;
 }
Ejemplo n.º 2
0
 public static DbIterator<Vote> getVotes(long pollId, int from, int to) {
   return voteTable.getManyBy(new DbClause.LongClause("poll_id", pollId), from, to);
 }
Ejemplo n.º 3
0
 public static Vote getVote(long pollId, long voterId) {
   DbClause clause =
       new DbClause.LongClause("poll_id", pollId)
           .and(new DbClause.LongClause("voter_id", voterId));
   return voteTable.getBy(clause);
 }
Ejemplo n.º 4
0
 public static int getCount() {
   return voteTable.getCount();
 }
Ejemplo n.º 5
0
 public static Vote getVote(long id) {
   return voteTable.get(voteDbKeyFactory.newKey(id));
 }
Ejemplo n.º 6
0
 static void addAsset(Transaction transaction, Attachment.ColoredCoinsAssetIssuance attachment) {
   assetTable.insert(new Asset(transaction, attachment));
 }
Ejemplo n.º 7
0
 public static DbIterator<Asset> getAssetsIssuedBy(long accountId, int from, int to) {
   return assetTable.getManyBy(new DbClause.LongClause("account_id", accountId), from, to);
 }
Ejemplo n.º 8
0
 public static Asset getAsset(long id) {
   return assetTable.get(assetDbKeyFactory.newKey(id));
 }
Ejemplo n.º 9
0
 public static int getCount() {
   return assetTable.getCount();
 }
Ejemplo n.º 10
0
 public static DbIterator<Asset> getAllAssets(int from, int to) {
   return assetTable.getAll(from, to);
 }