01: package org.contineo.core.document.dao;
02:
03: import java.util.Collection;
04:
05: import org.contineo.core.document.Article;
06:
07: /**
08: * DAO for <code>Article</code> handling.
09: *
10: * @author Michael Scholz
11: * @author Marco Meschieri
12: */
13: public interface ArticleDAO {
14:
15: /**
16: * This method persists a article object.
17: *
18: * @param article Article to be stored.
19: * @return True if successfully stored in a database.
20: */
21: public boolean store(Article article);
22:
23: /**
24: * This method deletes an article.
25: *
26: * @param articleid ArticleID of the article which should be delete.
27: */
28: public boolean delete(int articleid);
29:
30: /**
31: * This method finds an article by its primarykey.
32: *
33: * @param articleid Primarykey of the article.
34: * @return Article with given primarykey.
35: */
36: public Article findByPrimaryKey(int articleid);
37:
38: /**
39: * This method selects all articles of for a given document.
40: *
41: * @param docId - ID of the document.
42: */
43: public Collection<Article> findByDocId(int docId);
44:
45: /**
46: * This method selects all articles of the given user.
47: *
48: * @param username - ID of the user.
49: */
50: public Collection<Article> findByUserName(String username);
51: }
|