Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.UserStat


 
  public void testListUserStats() throws Exception{
    List<UserStat> stats = dao.listUserStats();
    assertEquals(2,stats.size());
   
    UserStat s1 = stats.get(0);
    UserStat s2 = stats.get(1);
   
    assertEquals("hchen1",s1.getUsername());
    assertEquals(3,s1.getNumOfBookmarks());
    assertEquals(1,s1.getNumOfTags());
   
    assertEquals("hchen2",s2.getUsername());
    assertEquals(1,s2.getNumOfBookmarks());
    assertEquals(1,s2.getNumOfTags());
  }
View Full Code Here


 
 
  public static UserStat createUserStatObject(ResultSet rs) throws SQLException{
    if(rs == null) return null;
    User user = createUserObject(rs);
    UserStat userStat = new UserStat(user);
    userStat.setNumOfBookmarks(rs.getInt(UserSchema.NUM_OF_BOOKMARKS));
    userStat.setNumOfTags(rs.getInt(UserSchema.NUM_OF_TAGS));
    return userStat;
  }
View Full Code Here

    try{       
      conn = datasource.getConnection();
      stmt = conn.prepareStatement("call listUserStats();");
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        UserStat aUser = createUserStatObject(rs);
        users.add(aUser);
        logger.debug("found: " + aUser);
      }
      if(users.size() == 0){
        logger.debug("found no matching user stat");
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.UserStat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.