Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.BookmarkTag


    bmTag = tagDao.getBookmarkTag(10);
    assertNull(bmTag);
  }
 
  public void testUpdateBookmarkTag() throws Exception{
    BookmarkTag bmTag = tagDao.getBookmarkTag(10);
    bmTag.setTag(new Tag(100));
    bmTag.setBookmark(new Bookmark(2));
    bmTag.setPosition(1001);
    boolean okay = tagDao.updateBookmarkTag(bmTag);
    assertTrue(okay);
   
    bmTag = tagDao.getBookmarkTag(10);
    assertEquals(100,bmTag.getTag().getId());
    assertEquals(2,bmTag.getBookmark().getId());
    assertEquals(1001,bmTag.getPosition());
  }
View Full Code Here


      logger.debug("userTag id = " + id);
      id = tagDao.createLinkTag(new LinkTag(link, tag));
      logger.debug("linkTag id = " + id);
      id = tagDao.getBookmarkTagId(bmark, tag);
      if (id <= 0) {
        id = tagDao.createBookmarkTag(new BookmarkTag(0, bmark, tag, 0,
            pos));
      } else {
        BookmarkTag bmtag = new BookmarkTag(id);
        bmtag.setBookmark(bmark);
        bmtag.setTag(tag);
        bmtag.setCount(0);
        bmtag.setPosition(pos);
        tagDao.updateBookmarkTag(bmtag);
      }
      pos++;
      logger.debug("bookmarkTag id = " + id);
    }
View Full Code Here

    return createUserTagObject(null, rs);
  }

  public static BookmarkTag createBookmarkTagObject(ResultSet rs) throws SQLException{
    if(rs == null) return null;
    BookmarkTag bookmarkTag = new BookmarkTag();
    bookmarkTag.setId(rs.getInt(BookmarkTagIdxSchema.ID));
    bookmarkTag.setCount(rs.getInt(BookmarkTagIdxSchema.COUNT));
    bookmarkTag.setPosition(rs.getInt(BookmarkTagIdxSchema.POSITION));
   
    Tag tag = createTagObject(rs);
    bookmarkTag.setTag(tag);
   
    Bookmark bookmark = BookmarkDBDao.createBookmarkObject2(rs);
    bookmarkTag.setBookmark(bookmark);
       
    return bookmarkTag;
  }
View Full Code Here

    return deleted;
  }

  public BookmarkTag getBookmarkTag(int id) {
    logger.debug("getBookmarkTag: id="+id);
    BookmarkTag tag = null;
    PreparedStatement stmt = null;
    Connection conn = null;
    try{           
      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call getBookmarkTag(?);");
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findBookmarkTagUserIdGrouped(?)");
      stmt.setInt(1,user.getId());
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        BookmarkTag aTag = createBookmarkTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching bookmark tags");
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findBookmarkTagByFolderId(?)");
      stmt.setInt(1,folder.getId());
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        BookmarkTag aTag = createBookmarkTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching bookmark tags");
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareStatement("call findBookmarkTagCommunitySearch(?)");
      stmt.setString(1,searchQuery);
      ResultSet rs = stmt.executeQuery();
      while(rs.next()){
        BookmarkTag aTag = createBookmarkTagObject(rs);
        tags.add(aTag);
        logger.debug("found: " + aTag);
      }
      if(tags.size() == 0){
        logger.debug("found no matching bookmark tags");
View Full Code Here

TOP

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

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.