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

http://thoughtsite.googlecode.com/ · Java · 98 lines · 15 code · 11 blank · 72 comment · 0 complexity · 8fa4cc3dd8394f688f0502d2e8a1a80c 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.Idea;
  17. import com.google.ie.business.domain.Project;
  18. import com.google.ie.business.domain.User;
  19. import com.google.ie.dto.RetrievalInfo;
  20. import java.util.List;
  21. import java.util.Set;
  22. /**
  23. * A data access object specification for Project entity.
  24. *
  25. * @author Charanjeet singh
  26. */
  27. public interface ProjectDao extends BaseDao {
  28. /**
  29. * Saves a {@link Project} which is being created from a published
  30. * {@link Idea}, into the data store.
  31. *
  32. * @param project {@link Project} object
  33. * @return Returns the saved project.
  34. */
  35. Project saveProject(Project project);
  36. /**
  37. * Retrieves the list of projects.
  38. *
  39. * All retrieval specific information can be passed using RetrievalInfo
  40. * object as a parameter.
  41. *
  42. * @param retrievalInfo {@link RetrievalInfo} object containing information
  43. * of startIndex and total number of records
  44. * @param statusOfProject the set of status to which the Project status
  45. * should be matched
  46. * @return Returns the Project list.
  47. */
  48. List<Project> getProjects(RetrievalInfo retrievalInfo, Set<String> statusOfProject);
  49. /**
  50. * Retrieves the list of projects associated with a User.
  51. *
  52. * All retrieval specific information can be passed using RetrievalInfo
  53. * object as a parameter.
  54. *
  55. * @param user The User object.
  56. * @param retrievalInfo {@link RetrievalInfo} object having information of
  57. * startIndex and total number of records
  58. * @param statusOfProject the set of status to which the Project status
  59. * should be matched
  60. * @return Returns the Project list.
  61. */
  62. List<Project> getProjects(User user, RetrievalInfo retrievalInfo, Set<String> statusOfProject);
  63. /**
  64. * Retrieves the details of a project
  65. *
  66. * @param projectKey String object holding the key of the project object to
  67. * be retrieved.
  68. * @return Project object.
  69. */
  70. Project getProject(String projectKey);
  71. /**
  72. * Get project by idea key.
  73. *
  74. * @param ideaKey primary key of entity Idea
  75. * @return List<Project> Returns the list of Projects.
  76. */
  77. List<Project> getProjectsByIdeaKey(String ideaKey);
  78. /**
  79. * Retrieves the projects by project keys.
  80. *
  81. * @param projectKeys Set of project keys.
  82. * @param retrievalInfo RetrievalInfo object having information of
  83. * startIndex and total number of records
  84. * @return Returns the list of Projects.
  85. */
  86. List<Project> getProjectsByKeys(Set<String> projectKeys, RetrievalInfo retrievalInfo);
  87. }