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

http://thoughtsite.googlecode.com/ · Java · 57 lines · 11 code · 8 blank · 38 comment · 0 complexity · 4dd27ff2dcca12e3052ab55f291eda1d 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.Comment;
  17. import com.google.ie.business.domain.Idea;
  18. import com.google.ie.business.domain.Project;
  19. import com.google.ie.dto.RetrievalInfo;
  20. import java.util.List;
  21. /**
  22. * A data access object specification for Comment entity.
  23. *
  24. * @author Sachneet
  25. *
  26. */
  27. public interface CommentDao extends BaseDao {
  28. /**
  29. * Saves a Comment object in to data store.
  30. *
  31. * @param comment {@link Comment} object to be saved.
  32. * @return saved comment object.
  33. */
  34. Comment saveComment(Comment comment);
  35. /**
  36. * Retrieves the list of {@link Comment} objects associated with an Idea
  37. * or Project.
  38. *
  39. * @param key the String object having key of an {@link Idea} or
  40. * a {@link Project} .
  41. * @param retrievalInfo the retrieval information parameter.
  42. * @param keyType it can be either ideaKey or projectkey.
  43. *
  44. * @return List of comment objects .It can be IdeaComment object list or
  45. * ProjectComment list.
  46. */
  47. <T extends Comment> List<T> getComments(String key, RetrievalInfo retrievalInfo,
  48. String keyType);
  49. }