⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postdao.java

📁 java servlet著名论坛源代码
💻 JAVA
字号:
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/PostDAO.java,v 1.9 2004/03/20 19:15:04 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.9 $
 * $Date: 2004/03/20 19:15:04 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2004 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 */
package com.mvnforum.db;

import java.sql.Timestamp;
import java.util.Collection;

import net.myvietnam.mvncore.exception.AssertionException;
import net.myvietnam.mvncore.exception.CreateException;
import net.myvietnam.mvncore.exception.DatabaseException;
import net.myvietnam.mvncore.exception.ObjectNotFoundException;
import net.myvietnam.mvncore.exception.ForeignKeyNotFoundException;

public interface PostDAO {

    public static final String TABLE_NAME = DatabaseConfig.TABLE_PREFIX + "Post";

    public void findByPrimaryKey(int postID)
        throws ObjectNotFoundException, DatabaseException;

    public int createPost(int parentPostID, int forumID, int threadID,
                          int memberID, String memberName, String lastEditMemberName,
                          String postTopic, String postBody, Timestamp postCreationDate,
                          Timestamp postLastEditDate, String postCreationIP, String postLastEditIP,
                          int postEditCount, int postFormatOption, int postOption,
                          int postStatus, String postIcon, int postAttachCount)
        throws CreateException, DatabaseException, ForeignKeyNotFoundException;

     public void delete(int postID)
         throws DatabaseException, ObjectNotFoundException;

     public void delete_inThread(int threadID)
         throws DatabaseException;

     public void delete_inForum(int forumID)
         throws DatabaseException;

     public void update(int postID, // primary key
                        String lastEditMemberName, String postTopic, String postBody,
                        Timestamp postLastEditDate, String postLastEditIP, int postFormatOption,
                        int postOption, int postStatus, String postIcon)
          throws ObjectNotFoundException, DatabaseException, ForeignKeyNotFoundException;

      public void updateAttachCount(int postID, // primary key
                                    int postAttachCount)
          throws ObjectNotFoundException, DatabaseException;

      public void updateStatus(int postID, // primary key
                               int postStatus)
          throws ObjectNotFoundException, DatabaseException;

      public void update_ForumID_inThread(int threadID, int forumID)
          throws DatabaseException, ForeignKeyNotFoundException;

      public void updateParentPostID(int oldParentPostID, int newParentPostID)
          throws ObjectNotFoundException, DatabaseException;

      public void increaseEditCount(int postID)
          throws DatabaseException, ObjectNotFoundException;

      public PostBean getPost(int postID)
          throws ObjectNotFoundException, DatabaseException;

      /**
       * This method is used the get the first post of thread for moderation
       *
       * @param threadID
       * @return
       * @throws ObjectNotFoundException
       * @throws DatabaseException
       */
      public PostBean getFirstPost_inThread(int threadID)
          throws ObjectNotFoundException, DatabaseException;

      public Collection getEnablePosts_inThread_limit(int threadID, int offset, int rowsToReturn)
          throws IllegalArgumentException, DatabaseException;

      public Collection getDisablePosts_inThread_limit(int threadID, int offset, int rowsToReturn)
          throws IllegalArgumentException, DatabaseException;

      public int getNumberOfEnablePosts_inThread(int threadID)
          throws AssertionException, DatabaseException;

      public int getNumberOfDisablePosts_inThread(int threadID)
          throws AssertionException, DatabaseException;

      public int getNumberOfPosts_inMember(int memberID)
          throws AssertionException, DatabaseException;

      /**
       * This method could be used to update the statistics of the forum
       *
       * @param forumID int
       * @throws AssertionException
       * @throws DatabaseException
       * @return int
       */
      public int getNumberOfEnablePosts_inForum(int forumID)
          throws AssertionException, DatabaseException;

      public int getNumberOfDisablePosts_inForum(int forumID)
          throws AssertionException, DatabaseException;

      /**
       * This method could be used to get all post when rebuild lucene search index
       *
       * @throws DatabaseException
       * @return Collection
       */
      public Collection getPosts() throws DatabaseException;

      /**
       * This method could be used to show the forum statistics
       *
       * @throws AssertionException
       * @throws DatabaseException
       * @return int
       */
      public int getNumberOfEnablePosts() throws AssertionException, DatabaseException;

      /**
       * This method could be used to get latest post in a thread to update
       * thread statistics. It also could be used to get the latest posts
       * when replying to a post
       *
       * @param threadID int
       * @param rowsToReturn int
       * @throws IllegalArgumentException
       * @throws DatabaseException
       * @return Collection
       */
      public Collection getLastEnablePosts_inThread_limit(int threadID, int rowsToReturn)
          throws IllegalArgumentException, DatabaseException;

      /**
       * This method could be used to update forum statistics by getting one
       * last post in a forum
       *
       * @param forumID int
       * @param rowsToReturn int
       * @throws IllegalArgumentException
       * @throws DatabaseException
       * @return Collection
       */
      public Collection getLastEnablePosts_inForum_limit(int forumID, int rowsToReturn)
          throws IllegalArgumentException, DatabaseException;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -