Example #1
0
  public Vote(int uid, int sid) {
    this.uid = uid;
    this.sid = sid;

    String query = "SELECT upvote FROM votes WHERE uid = ? AND sid = ?";
    ArrayList<Object> args = new ArrayList<Object>();
    args.add(new Integer(uid));
    args.add(new Integer(sid));
    vote = DataAccess.queryReturnInt(get_vote, query, args, "upvote");

    ObjectCache cache = ObjectCache.getInstance();
    cache.addObject(this, uid, sid, "votes");
  }