Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: ru/gammalabs/ice/forum/MessageDAO.java


1   /*
2    * $Id: MessageDAO.java,v 1.1 2002/12/08 08:30:09 dimitry Exp $
3    *
4    * Copyright (c) 2002, by GammaLabs
5    * ==================================================================
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 2.1 of the License, or (at your option) any later version.
10   *
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19   * ==================================================================
20   */
21  package ru.gammalabs.ice.forum;
22  
23  import ru.gammalabs.ice.framework.ObjectNotFoundException;
24  import ru.gammalabs.ice.framework.DAO;
25  
26  import java.util.List;
27  
28  public interface MessageDAO extends DAO
29  {
30    /**
31     * Получаем сообщение по его идентификатору
32     * @param id
33     * @return модель сообщения.
34     * @throws ru.gammalabs.ice.framework.ObjectNotFoundException
35     */
36    public MessageModel findMessageById(long id)
37      throws ObjectNotFoundException;
38  
39    /**
40     * Получаем список всех сообщений по идентификатору родительского сообщения
41     * @param id идентификатор родительского сообщения
42     * @return список сообщений
43     */
44    public List findAllMessagesByParentId(long id);
45  
46    /**
47     * Получаем список открытых сообщений по идентификатору родительского сообщения
48     * @param id идентификатор родительского сообщения
49     * @return список сообщений
50     */
51    public List findOpenedMessagesByParentId(long id);
52  
53    /**
54     * Получаем список всех веток (сообщения, где parentId=0) для заданного форума
55     * @param id идентификатор форума
56     * @return список веток
57     */
58    public List findAllThreadsByPartitionId(long id);
59  
60    /**
61     * Получаем список открытых веток (сообщения, где parentId=0) для заданного форума
62     * @param id идентификатор форума
63     * @return список веток
64     */
65    public List findOpenedThreadsByPartitionId(long id);
66  
67    /**
68     * Добавляем новое сообщение в форум
69     * @param model сообщение
70     */
71    public void create(MessageModel model);
72  
73    /**
74     * Обновляем сообщение
75     * @param model сообщение
76     */
77    public void update(MessageModel model);
78  
79    /**
80     * Удаление сообщения
81     * @param id идентификатор сообщения
82     */
83    public void remove(long id);
84  }