/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. package com.google.ie.business.dao;
  16. import com.google.ie.business.domain.CommentVote;
  17. import com.google.ie.business.domain.IdeaVote;
  18. import com.google.ie.business.domain.Vote;
  19. /**
  20. * A data access object specification for Vote entity.
  21. *
  22. * @author asirohi
  23. *
  24. */
  25. public interface VoteDao extends BaseDao {
  26. /**
  27. *
  28. * Saves the Vote entity to data store.
  29. *
  30. * @param vote object to save
  31. * @return saved vote object.
  32. */
  33. Vote saveVote(Vote vote);
  34. /**
  35. * Get idea vote by idea key
  36. *
  37. * @param ideaKey primary key of idea.
  38. * @return IdeaVote
  39. */
  40. IdeaVote getIdeaVote(String ideaKey);
  41. /**
  42. * Get comment vote on the basis of comment key.
  43. *
  44. * @param commentKey primary key of comment key.
  45. * @return CommentVote
  46. */
  47. CommentVote getCommentVote(String commentKey);
  48. /**
  49. * Check for idea if idea is already voted by user.
  50. *
  51. * @param userKey primary key of user
  52. * @param ideaKey primary key of idea
  53. * @return boolean
  54. */
  55. boolean isIdeaAlreadyVotedByUser(String userKey, String ideaKey);
  56. /**
  57. * Check for idea if comment is already voted by user.
  58. *
  59. * @param userKey primary key of user
  60. * @param commentKey primary key of comment
  61. * @return boolean
  62. */
  63. boolean isCommentAlreadyVotedByUser(String userKey, String commentKey);
  64. }