PageRenderTime 433ms CodeModel.GetById 177ms app.highlight 3ms RepoModel.GetById 166ms app.codeStats 0ms

/src/main/java/com/google/ie/business/dao/VoteDao.java

http://thoughtsite.googlecode.com/
Java | 77 lines | 11 code | 13 blank | 53 comment | 0 complexity | 445167690456a565a3d805673b3c8d72 MD5 | raw file
 1/* Copyright 2010 Google Inc.
 2 * 
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 * 
 7 *      http://www.apache.org/licenses/LICENSE-2.0
 8 * 
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS.
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
14 */
15
16package com.google.ie.business.dao;
17
18import com.google.ie.business.domain.CommentVote;
19import com.google.ie.business.domain.IdeaVote;
20import com.google.ie.business.domain.Vote;
21
22/**
23 * A data access object specification for Vote entity.
24 * 
25 * @author asirohi
26 * 
27 */
28public interface VoteDao extends BaseDao {
29
30    /**
31     * 
32     * Saves the Vote entity to data store.
33     * 
34     * @param vote object to save
35     * @return saved vote object.
36     */
37    Vote saveVote(Vote vote);
38
39    /**
40     * Get idea vote by idea key
41     * 
42     * @param ideaKey primary key of idea.
43     * @return IdeaVote
44     */
45    IdeaVote getIdeaVote(String ideaKey);
46
47    /**
48     * Get comment vote on the basis of comment key.
49     * 
50     * @param commentKey primary key of comment key.
51     * @return CommentVote
52     */
53
54    CommentVote getCommentVote(String commentKey);
55
56    /**
57     * Check for idea if idea is already voted by user.
58     * 
59     * @param userKey primary key of user
60     * @param ideaKey primary key of idea
61     * @return boolean
62     */
63
64    boolean isIdeaAlreadyVotedByUser(String userKey, String ideaKey);
65
66    /**
67     * Check for idea if comment is already voted by user.
68     * 
69     * @param userKey primary key of user
70     * @param commentKey primary key of comment
71     * @return boolean
72     */
73
74    boolean isCommentAlreadyVotedByUser(String userKey, String commentKey);
75
76}
77