KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > dao > entity > IPostDAO


1 package org.javabb.dao.entity;
2
3 import java.util.List JavaDoc;
4
5 import org.javabb.dao.DAOConstants;
6 import org.javabb.vo.Forum;
7 import org.javabb.vo.Post;
8 import org.javabb.vo.Topic;
9
10 /*
11  * Copyright 2004 JavaFree.org
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */

25
26 /**
27  * $Id: IPostDAO.java,v 1.8.4.2.6.2 2006/04/17 17:47:26 daltoncamargo Exp $
28  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
29  * @author Ronald Tetsuo Miura
30  * @author <a HREF="mailto:jackganzha@dev.java.net">Marcos Silva Pereira</a>
31  */

32 public interface IPostDAO extends DAOConstants {
33
34     /**
35      * @param id
36      * @return post
37      */

38     public Post load(Long JavaDoc id);
39
40     /**
41      * @return last post
42      */

43     public Post findLastPost();
44
45     public List JavaDoc findLastPosts(int limit);
46     
47     /**
48      * @param topic
49      * @return list
50      */

51     public List JavaDoc findByTopicDesc(Topic topic);
52     
53     /**
54      * @param forum
55      * @return list
56      */

57     public List JavaDoc findByForumDesc(Forum forum);
58
59     /**
60      * @param forum
61      * @return count
62      */

63     public Integer JavaDoc findCountOfPostsByForum(Forum forum);
64
65     
66     /**
67      * Number of rows found into Lucene index
68      * @param query - keywords to search rows
69      * @return number of rows
70      */

71     public int getTotalRowsOfLucene(String JavaDoc query);
72     
73     /**
74      * @param query
75      * @return post list
76      */

77     public List JavaDoc search(String JavaDoc query, int pageNumber, int numItems);
78     
79     /**
80      * Search using the String with space parameters
81      * @param query
82      * @return
83      */

84     public List JavaDoc search(final String JavaDoc query, final int page);
85
86     /**
87      * @param idTopic
88      * @return post count
89      */

90     public int countPostsByTopic(Long JavaDoc idTopic);
91
92     /**
93      * @param topicId
94      * @param rowsPerPage
95      * @param pageNumber
96      * @return post list
97      */

98     public List JavaDoc findByTopic(Long JavaDoc topicId, int pageNumber, int rowsPerPage);
99
100     /**
101      * @param id
102      * @return post list
103      */

104     public List JavaDoc findByUser( Long JavaDoc userId, int pageNumber, int itemsPerPage );
105
106     public int countPostsByUser(Long JavaDoc userId);
107     
108     /**
109      * @return post list
110      */

111     public List JavaDoc findUnanswered(int pageNumber, int itemsPerPage);
112
113     public int countUnanswered();
114     
115     /**
116      * @param post
117      */

118     public void update(Post post);
119
120     /**
121      * @param post
122      * @return new post id
123      */

124     public Long JavaDoc create(Post post);
125
126     /**
127      * @param postId
128      */

129     public void delete(Long JavaDoc postId);
130
131     /**
132      * @return post total count
133      */

134     public int countAllPosts();
135 }
136
Popular Tags