1   /**
2    * Copyright (c) 2000-2009 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 extends BasePersistence {
32      public void cacheResult(com.liferay.portal.model.Organization organization);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portal.model.Organization> organizations);
36  
37      public void clearCache();
38  
39      public com.liferay.portal.model.Organization create(long organizationId);
40  
41      public com.liferay.portal.model.Organization remove(long organizationId)
42          throws com.liferay.portal.NoSuchOrganizationException,
43              com.liferay.portal.SystemException;
44  
45      public com.liferay.portal.model.Organization remove(
46          com.liferay.portal.model.Organization organization)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * @deprecated Use <code>update(Organization organization, boolean merge)</code>.
51       */
52      public com.liferay.portal.model.Organization update(
53          com.liferay.portal.model.Organization organization)
54          throws com.liferay.portal.SystemException;
55  
56      /**
57       * Add, update, or merge, the entity. This method also calls the model
58       * listeners to trigger the proper events associated with adding, deleting,
59       * or updating an entity.
60       *
61       * @param        organization the entity to add, update, or merge
62       * @param        merge boolean value for whether to merge the entity. The
63       *                default value is false. Setting merge to true is more
64       *                expensive and should only be true when organization is
65       *                transient. See LEP-5473 for a detailed discussion of this
66       *                method.
67       * @return        true if the portlet can be displayed via Ajax
68       */
69      public com.liferay.portal.model.Organization update(
70          com.liferay.portal.model.Organization organization, boolean merge)
71          throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portal.model.Organization updateImpl(
74          com.liferay.portal.model.Organization organization, boolean merge)
75          throws com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.Organization findByPrimaryKey(
78          long organizationId)
79          throws com.liferay.portal.NoSuchOrganizationException,
80              com.liferay.portal.SystemException;
81  
82      public com.liferay.portal.model.Organization fetchByPrimaryKey(
83          long organizationId) throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
86          long companyId) throws com.liferay.portal.SystemException;
87  
88      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
89          long companyId, int start, int end)
90          throws com.liferay.portal.SystemException;
91  
92      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
93          long companyId, int start, int end,
94          com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Organization findByCompanyId_First(
98          long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.NoSuchOrganizationException,
100             com.liferay.portal.SystemException;
101 
102     public com.liferay.portal.model.Organization findByCompanyId_Last(
103         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
104         throws com.liferay.portal.NoSuchOrganizationException,
105             com.liferay.portal.SystemException;
106 
107     public com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
108         long organizationId, long companyId,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.NoSuchOrganizationException,
111             com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
114         long companyId) throws com.liferay.portal.SystemException;
115 
116     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
117         long companyId, int start, int end)
118         throws com.liferay.portal.SystemException;
119 
120     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
121         long companyId, int start, int end,
122         com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException;
124 
125     public com.liferay.portal.model.Organization findByLocations_First(
126         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.NoSuchOrganizationException,
128             com.liferay.portal.SystemException;
129 
130     public com.liferay.portal.model.Organization findByLocations_Last(
131         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchOrganizationException,
133             com.liferay.portal.SystemException;
134 
135     public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
136         long organizationId, long companyId,
137         com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchOrganizationException,
139             com.liferay.portal.SystemException;
140 
141     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
142         long companyId, long parentOrganizationId)
143         throws com.liferay.portal.SystemException;
144 
145     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
146         long companyId, long parentOrganizationId, int start, int end)
147         throws com.liferay.portal.SystemException;
148 
149     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
150         long companyId, long parentOrganizationId, int start, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException;
153 
154     public com.liferay.portal.model.Organization findByC_P_First(
155         long companyId, long parentOrganizationId,
156         com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.NoSuchOrganizationException,
158             com.liferay.portal.SystemException;
159 
160     public com.liferay.portal.model.Organization findByC_P_Last(
161         long companyId, long parentOrganizationId,
162         com.liferay.portal.kernel.util.OrderByComparator obc)
163         throws com.liferay.portal.NoSuchOrganizationException,
164             com.liferay.portal.SystemException;
165 
166     public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
167         long organizationId, long companyId, long parentOrganizationId,
168         com.liferay.portal.kernel.util.OrderByComparator obc)
169         throws com.liferay.portal.NoSuchOrganizationException,
170             com.liferay.portal.SystemException;
171 
172     public com.liferay.portal.model.Organization findByC_N(long companyId,
173         java.lang.String name)
174         throws com.liferay.portal.NoSuchOrganizationException,
175             com.liferay.portal.SystemException;
176 
177     public com.liferay.portal.model.Organization fetchByC_N(long companyId,
178         java.lang.String name) throws com.liferay.portal.SystemException;
179 
180     public com.liferay.portal.model.Organization fetchByC_N(long companyId,
181         java.lang.String name, boolean retrieveFromCache)
182         throws com.liferay.portal.SystemException;
183 
184     public java.util.List<Object> findWithDynamicQuery(
185         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
186         throws com.liferay.portal.SystemException;
187 
188     public java.util.List<Object> findWithDynamicQuery(
189         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
190         int end) throws com.liferay.portal.SystemException;
191 
192     public java.util.List<com.liferay.portal.model.Organization> findAll()
193         throws com.liferay.portal.SystemException;
194 
195     public java.util.List<com.liferay.portal.model.Organization> findAll(
196         int start, int end) throws com.liferay.portal.SystemException;
197 
198     public java.util.List<com.liferay.portal.model.Organization> findAll(
199         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
200         throws com.liferay.portal.SystemException;
201 
202     public void removeByCompanyId(long companyId)
203         throws com.liferay.portal.SystemException;
204 
205     public void removeByLocations(long companyId)
206         throws com.liferay.portal.SystemException;
207 
208     public void removeByC_P(long companyId, long parentOrganizationId)
209         throws com.liferay.portal.SystemException;
210 
211     public void removeByC_N(long companyId, java.lang.String name)
212         throws com.liferay.portal.NoSuchOrganizationException,
213             com.liferay.portal.SystemException;
214 
215     public void removeAll() throws com.liferay.portal.SystemException;
216 
217     public int countByCompanyId(long companyId)
218         throws com.liferay.portal.SystemException;
219 
220     public int countByLocations(long companyId)
221         throws com.liferay.portal.SystemException;
222 
223     public int countByC_P(long companyId, long parentOrganizationId)
224         throws com.liferay.portal.SystemException;
225 
226     public int countByC_N(long companyId, java.lang.String name)
227         throws com.liferay.portal.SystemException;
228 
229     public int countAll() throws com.liferay.portal.SystemException;
230 
231     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
232         throws com.liferay.portal.SystemException;
233 
234     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
235         int start, int end) throws com.liferay.portal.SystemException;
236 
237     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
238         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
239         throws com.liferay.portal.SystemException;
240 
241     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
242 
243     public boolean containsGroup(long pk, long groupPK)
244         throws com.liferay.portal.SystemException;
245 
246     public boolean containsGroups(long pk)
247         throws com.liferay.portal.SystemException;
248 
249     public void addGroup(long pk, long groupPK)
250         throws com.liferay.portal.SystemException;
251 
252     public void addGroup(long pk, com.liferay.portal.model.Group group)
253         throws com.liferay.portal.SystemException;
254 
255     public void addGroups(long pk, long[] groupPKs)
256         throws com.liferay.portal.SystemException;
257 
258     public void addGroups(long pk,
259         java.util.List<com.liferay.portal.model.Group> groups)
260         throws com.liferay.portal.SystemException;
261 
262     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
263 
264     public void removeGroup(long pk, long groupPK)
265         throws com.liferay.portal.SystemException;
266 
267     public void removeGroup(long pk, com.liferay.portal.model.Group group)
268         throws com.liferay.portal.SystemException;
269 
270     public void removeGroups(long pk, long[] groupPKs)
271         throws com.liferay.portal.SystemException;
272 
273     public void removeGroups(long pk,
274         java.util.List<com.liferay.portal.model.Group> groups)
275         throws com.liferay.portal.SystemException;
276 
277     public void setGroups(long pk, long[] groupPKs)
278         throws com.liferay.portal.SystemException;
279 
280     public void setGroups(long pk,
281         java.util.List<com.liferay.portal.model.Group> groups)
282         throws com.liferay.portal.SystemException;
283 
284     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
285         throws com.liferay.portal.SystemException;
286 
287     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
288         int start, int end) throws com.liferay.portal.SystemException;
289 
290     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
291         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
292         throws com.liferay.portal.SystemException;
293 
294     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
295 
296     public boolean containsUser(long pk, long userPK)
297         throws com.liferay.portal.SystemException;
298 
299     public boolean containsUsers(long pk)
300         throws com.liferay.portal.SystemException;
301 
302     public void addUser(long pk, long userPK)
303         throws com.liferay.portal.SystemException;
304 
305     public void addUser(long pk, com.liferay.portal.model.User user)
306         throws com.liferay.portal.SystemException;
307 
308     public void addUsers(long pk, long[] userPKs)
309         throws com.liferay.portal.SystemException;
310 
311     public void addUsers(long pk,
312         java.util.List<com.liferay.portal.model.User> users)
313         throws com.liferay.portal.SystemException;
314 
315     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
316 
317     public void removeUser(long pk, long userPK)
318         throws com.liferay.portal.SystemException;
319 
320     public void removeUser(long pk, com.liferay.portal.model.User user)
321         throws com.liferay.portal.SystemException;
322 
323     public void removeUsers(long pk, long[] userPKs)
324         throws com.liferay.portal.SystemException;
325 
326     public void removeUsers(long pk,
327         java.util.List<com.liferay.portal.model.User> users)
328         throws com.liferay.portal.SystemException;
329 
330     public void setUsers(long pk, long[] userPKs)
331         throws com.liferay.portal.SystemException;
332 
333     public void setUsers(long pk,
334         java.util.List<com.liferay.portal.model.User> users)
335         throws com.liferay.portal.SystemException;
336 
337     public void rebuildTree(long companyId, boolean force)
338         throws com.liferay.portal.SystemException;
339 }