1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="OrganizationPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface OrganizationPersistence {
32      public com.liferay.portal.model.Organization create(long organizationId);
33  
34      public com.liferay.portal.model.Organization remove(long organizationId)
35          throws com.liferay.portal.SystemException,
36              com.liferay.portal.NoSuchOrganizationException;
37  
38      public com.liferay.portal.model.Organization remove(
39          com.liferay.portal.model.Organization organization)
40          throws com.liferay.portal.SystemException;
41  
42      /**
43       * @deprecated Use <code>update(Organization organization, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.Organization update(
46          com.liferay.portal.model.Organization organization)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * Add, update, or merge, the entity. This method also calls the model
51       * listeners to trigger the proper events associated with adding, deleting,
52       * or updating an entity.
53       *
54       * @param        organization the entity to add, update, or merge
55       * @param        merge boolean value for whether to merge the entity. The
56       *                default value is false. Setting merge to true is more
57       *                expensive and should only be true when organization is
58       *                transient. See LEP-5473 for a detailed discussion of this
59       *                method.
60       * @return        true if the portlet can be displayed via Ajax
61       */
62      public com.liferay.portal.model.Organization update(
63          com.liferay.portal.model.Organization organization, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.Organization updateImpl(
67          com.liferay.portal.model.Organization organization, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Organization findByPrimaryKey(
71          long organizationId)
72          throws com.liferay.portal.SystemException,
73              com.liferay.portal.NoSuchOrganizationException;
74  
75      public com.liferay.portal.model.Organization fetchByPrimaryKey(
76          long organizationId) throws com.liferay.portal.SystemException;
77  
78      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
79          long companyId) throws com.liferay.portal.SystemException;
80  
81      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
82          long companyId, int begin, int end)
83          throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
86          long companyId, int begin, int end,
87          com.liferay.portal.kernel.util.OrderByComparator obc)
88          throws com.liferay.portal.SystemException;
89  
90      public com.liferay.portal.model.Organization findByCompanyId_First(
91          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
92          throws com.liferay.portal.SystemException,
93              com.liferay.portal.NoSuchOrganizationException;
94  
95      public com.liferay.portal.model.Organization findByCompanyId_Last(
96          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portal.NoSuchOrganizationException;
99  
100     public com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
101         long organizationId, long companyId,
102         com.liferay.portal.kernel.util.OrderByComparator obc)
103         throws com.liferay.portal.SystemException,
104             com.liferay.portal.NoSuchOrganizationException;
105 
106     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
107         long companyId) throws com.liferay.portal.SystemException;
108 
109     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
110         long companyId, int begin, int end)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
114         long companyId, int begin, int end,
115         com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException;
117 
118     public com.liferay.portal.model.Organization findByLocations_First(
119         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException,
121             com.liferay.portal.NoSuchOrganizationException;
122 
123     public com.liferay.portal.model.Organization findByLocations_Last(
124         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portal.NoSuchOrganizationException;
127 
128     public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
129         long organizationId, long companyId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portal.NoSuchOrganizationException;
133 
134     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
135         long companyId, long parentOrganizationId)
136         throws com.liferay.portal.SystemException;
137 
138     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
139         long companyId, long parentOrganizationId, int begin, int end)
140         throws com.liferay.portal.SystemException;
141 
142     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
143         long companyId, long parentOrganizationId, int begin, int end,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException;
146 
147     public com.liferay.portal.model.Organization findByC_P_First(
148         long companyId, long parentOrganizationId,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.SystemException,
151             com.liferay.portal.NoSuchOrganizationException;
152 
153     public com.liferay.portal.model.Organization findByC_P_Last(
154         long companyId, long parentOrganizationId,
155         com.liferay.portal.kernel.util.OrderByComparator obc)
156         throws com.liferay.portal.SystemException,
157             com.liferay.portal.NoSuchOrganizationException;
158 
159     public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
160         long organizationId, long companyId, long parentOrganizationId,
161         com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.SystemException,
163             com.liferay.portal.NoSuchOrganizationException;
164 
165     public com.liferay.portal.model.Organization findByC_N(long companyId,
166         java.lang.String name)
167         throws com.liferay.portal.SystemException,
168             com.liferay.portal.NoSuchOrganizationException;
169 
170     public com.liferay.portal.model.Organization fetchByC_N(long companyId,
171         java.lang.String name) throws com.liferay.portal.SystemException;
172 
173     public java.util.List<com.liferay.portal.model.Organization> findWithDynamicQuery(
174         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
175         throws com.liferay.portal.SystemException;
176 
177     public java.util.List<com.liferay.portal.model.Organization> findWithDynamicQuery(
178         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
179         int begin, int end) throws com.liferay.portal.SystemException;
180 
181     public java.util.List<com.liferay.portal.model.Organization> findAll()
182         throws com.liferay.portal.SystemException;
183 
184     public java.util.List<com.liferay.portal.model.Organization> findAll(
185         int begin, int end) throws com.liferay.portal.SystemException;
186 
187     public java.util.List<com.liferay.portal.model.Organization> findAll(
188         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException;
190 
191     public void removeByCompanyId(long companyId)
192         throws com.liferay.portal.SystemException;
193 
194     public void removeByLocations(long companyId)
195         throws com.liferay.portal.SystemException;
196 
197     public void removeByC_P(long companyId, long parentOrganizationId)
198         throws com.liferay.portal.SystemException;
199 
200     public void removeByC_N(long companyId, java.lang.String name)
201         throws com.liferay.portal.SystemException,
202             com.liferay.portal.NoSuchOrganizationException;
203 
204     public void removeAll() throws com.liferay.portal.SystemException;
205 
206     public int countByCompanyId(long companyId)
207         throws com.liferay.portal.SystemException;
208 
209     public int countByLocations(long companyId)
210         throws com.liferay.portal.SystemException;
211 
212     public int countByC_P(long companyId, long parentOrganizationId)
213         throws com.liferay.portal.SystemException;
214 
215     public int countByC_N(long companyId, java.lang.String name)
216         throws com.liferay.portal.SystemException;
217 
218     public int countAll() throws com.liferay.portal.SystemException;
219 
220     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
221         throws com.liferay.portal.SystemException,
222             com.liferay.portal.NoSuchOrganizationException;
223 
224     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
225         int begin, int end)
226         throws com.liferay.portal.SystemException,
227             com.liferay.portal.NoSuchOrganizationException;
228 
229     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
230         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
231         throws com.liferay.portal.SystemException,
232             com.liferay.portal.NoSuchOrganizationException;
233 
234     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
235 
236     public boolean containsGroup(long pk, long groupPK)
237         throws com.liferay.portal.SystemException;
238 
239     public boolean containsGroups(long pk)
240         throws com.liferay.portal.SystemException;
241 
242     public void addGroup(long pk, long groupPK)
243         throws com.liferay.portal.SystemException,
244             com.liferay.portal.NoSuchGroupException,
245             com.liferay.portal.NoSuchOrganizationException;
246 
247     public void addGroup(long pk, com.liferay.portal.model.Group group)
248         throws com.liferay.portal.SystemException,
249             com.liferay.portal.NoSuchGroupException,
250             com.liferay.portal.NoSuchOrganizationException;
251 
252     public void addGroups(long pk, long[] groupPKs)
253         throws com.liferay.portal.SystemException,
254             com.liferay.portal.NoSuchGroupException,
255             com.liferay.portal.NoSuchOrganizationException;
256 
257     public void addGroups(long pk,
258         java.util.List<com.liferay.portal.model.Group> groups)
259         throws com.liferay.portal.SystemException,
260             com.liferay.portal.NoSuchGroupException,
261             com.liferay.portal.NoSuchOrganizationException;
262 
263     public void clearGroups(long pk)
264         throws com.liferay.portal.SystemException,
265             com.liferay.portal.NoSuchOrganizationException;
266 
267     public void removeGroup(long pk, long groupPK)
268         throws com.liferay.portal.SystemException,
269             com.liferay.portal.NoSuchGroupException,
270             com.liferay.portal.NoSuchOrganizationException;
271 
272     public void removeGroup(long pk, com.liferay.portal.model.Group group)
273         throws com.liferay.portal.SystemException,
274             com.liferay.portal.NoSuchGroupException,
275             com.liferay.portal.NoSuchOrganizationException;
276 
277     public void removeGroups(long pk, long[] groupPKs)
278         throws com.liferay.portal.SystemException,
279             com.liferay.portal.NoSuchGroupException,
280             com.liferay.portal.NoSuchOrganizationException;
281 
282     public void removeGroups(long pk,
283         java.util.List<com.liferay.portal.model.Group> groups)
284         throws com.liferay.portal.SystemException,
285             com.liferay.portal.NoSuchGroupException,
286             com.liferay.portal.NoSuchOrganizationException;
287 
288     public void setGroups(long pk, long[] groupPKs)
289         throws com.liferay.portal.SystemException,
290             com.liferay.portal.NoSuchGroupException,
291             com.liferay.portal.NoSuchOrganizationException;
292 
293     public void setGroups(long pk,
294         java.util.List<com.liferay.portal.model.Group> groups)
295         throws com.liferay.portal.SystemException,
296             com.liferay.portal.NoSuchGroupException,
297             com.liferay.portal.NoSuchOrganizationException;
298 
299     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
300         throws com.liferay.portal.SystemException,
301             com.liferay.portal.NoSuchOrganizationException;
302 
303     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
304         int begin, int end)
305         throws com.liferay.portal.SystemException,
306             com.liferay.portal.NoSuchOrganizationException;
307 
308     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
309         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
310         throws com.liferay.portal.SystemException,
311             com.liferay.portal.NoSuchOrganizationException;
312 
313     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
314 
315     public boolean containsUser(long pk, long userPK)
316         throws com.liferay.portal.SystemException;
317 
318     public boolean containsUsers(long pk)
319         throws com.liferay.portal.SystemException;
320 
321     public void addUser(long pk, long userPK)
322         throws com.liferay.portal.SystemException,
323             com.liferay.portal.NoSuchOrganizationException,
324             com.liferay.portal.NoSuchUserException;
325 
326     public void addUser(long pk, com.liferay.portal.model.User user)
327         throws com.liferay.portal.SystemException,
328             com.liferay.portal.NoSuchOrganizationException,
329             com.liferay.portal.NoSuchUserException;
330 
331     public void addUsers(long pk, long[] userPKs)
332         throws com.liferay.portal.SystemException,
333             com.liferay.portal.NoSuchOrganizationException,
334             com.liferay.portal.NoSuchUserException;
335 
336     public void addUsers(long pk,
337         java.util.List<com.liferay.portal.model.User> users)
338         throws com.liferay.portal.SystemException,
339             com.liferay.portal.NoSuchOrganizationException,
340             com.liferay.portal.NoSuchUserException;
341 
342     public void clearUsers(long pk)
343         throws com.liferay.portal.SystemException,
344             com.liferay.portal.NoSuchOrganizationException;
345 
346     public void removeUser(long pk, long userPK)
347         throws com.liferay.portal.SystemException,
348             com.liferay.portal.NoSuchOrganizationException,
349             com.liferay.portal.NoSuchUserException;
350 
351     public void removeUser(long pk, com.liferay.portal.model.User user)
352         throws com.liferay.portal.SystemException,
353             com.liferay.portal.NoSuchOrganizationException,
354             com.liferay.portal.NoSuchUserException;
355 
356     public void removeUsers(long pk, long[] userPKs)
357         throws com.liferay.portal.SystemException,
358             com.liferay.portal.NoSuchOrganizationException,
359             com.liferay.portal.NoSuchUserException;
360 
361     public void removeUsers(long pk,
362         java.util.List<com.liferay.portal.model.User> users)
363         throws com.liferay.portal.SystemException,
364             com.liferay.portal.NoSuchOrganizationException,
365             com.liferay.portal.NoSuchUserException;
366 
367     public void setUsers(long pk, long[] userPKs)
368         throws com.liferay.portal.SystemException,
369             com.liferay.portal.NoSuchOrganizationException,
370             com.liferay.portal.NoSuchUserException;
371 
372     public void setUsers(long pk,
373         java.util.List<com.liferay.portal.model.User> users)
374         throws com.liferay.portal.SystemException,
375             com.liferay.portal.NoSuchOrganizationException,
376             com.liferay.portal.NoSuchUserException;
377 }