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  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  
30  /**
31   * <a href="OrganizationPersistence.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   *
35   */
36  @Transactional(rollbackFor =  {
37      PortalException.class, SystemException.class})
38  public interface OrganizationPersistence extends BasePersistence {
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      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
78      public com.liferay.portal.model.Organization findByPrimaryKey(
79          long organizationId)
80          throws com.liferay.portal.NoSuchOrganizationException,
81              com.liferay.portal.SystemException;
82  
83      public com.liferay.portal.model.Organization fetchByPrimaryKey(
84          long organizationId) throws com.liferay.portal.SystemException;
85  
86      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
87      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
88          long companyId) throws com.liferay.portal.SystemException;
89  
90      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
91      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
92          long companyId, int start, int end)
93          throws com.liferay.portal.SystemException;
94  
95      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
96      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
97          long companyId, int start, int end,
98          com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.SystemException;
100 
101     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
102     public com.liferay.portal.model.Organization findByCompanyId_First(
103         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
104         throws com.liferay.portal.NoSuchOrganizationException,
105             com.liferay.portal.SystemException;
106 
107     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
108     public com.liferay.portal.model.Organization findByCompanyId_Last(
109         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.NoSuchOrganizationException,
111             com.liferay.portal.SystemException;
112 
113     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
114     public com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
115         long organizationId, long companyId,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.NoSuchOrganizationException,
118             com.liferay.portal.SystemException;
119 
120     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
122         long companyId) throws com.liferay.portal.SystemException;
123 
124     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
126         long companyId, int start, int end)
127         throws com.liferay.portal.SystemException;
128 
129     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
130     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
131         long companyId, int start, int end,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException;
134 
135     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136     public com.liferay.portal.model.Organization findByLocations_First(
137         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.NoSuchOrganizationException,
139             com.liferay.portal.SystemException;
140 
141     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
142     public com.liferay.portal.model.Organization findByLocations_Last(
143         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.NoSuchOrganizationException,
145             com.liferay.portal.SystemException;
146 
147     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148     public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
149         long organizationId, long companyId,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.NoSuchOrganizationException,
152             com.liferay.portal.SystemException;
153 
154     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
156         long companyId, long parentOrganizationId)
157         throws com.liferay.portal.SystemException;
158 
159     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
161         long companyId, long parentOrganizationId, int start, int end)
162         throws com.liferay.portal.SystemException;
163 
164     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165     public java.util.List<com.liferay.portal.model.Organization> findByC_P(
166         long companyId, long parentOrganizationId, int start, int end,
167         com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.SystemException;
169 
170     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171     public com.liferay.portal.model.Organization findByC_P_First(
172         long companyId, long parentOrganizationId,
173         com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.NoSuchOrganizationException,
175             com.liferay.portal.SystemException;
176 
177     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178     public com.liferay.portal.model.Organization findByC_P_Last(
179         long companyId, long parentOrganizationId,
180         com.liferay.portal.kernel.util.OrderByComparator obc)
181         throws com.liferay.portal.NoSuchOrganizationException,
182             com.liferay.portal.SystemException;
183 
184     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185     public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
186         long organizationId, long companyId, long parentOrganizationId,
187         com.liferay.portal.kernel.util.OrderByComparator obc)
188         throws com.liferay.portal.NoSuchOrganizationException,
189             com.liferay.portal.SystemException;
190 
191     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
192     public com.liferay.portal.model.Organization findByC_N(long companyId,
193         java.lang.String name)
194         throws com.liferay.portal.NoSuchOrganizationException,
195             com.liferay.portal.SystemException;
196 
197     public com.liferay.portal.model.Organization fetchByC_N(long companyId,
198         java.lang.String name) throws com.liferay.portal.SystemException;
199 
200     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201     public java.util.List<Object> findWithDynamicQuery(
202         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
203         throws com.liferay.portal.SystemException;
204 
205     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206     public java.util.List<Object> findWithDynamicQuery(
207         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
208         int end) throws com.liferay.portal.SystemException;
209 
210     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211     public java.util.List<com.liferay.portal.model.Organization> findAll()
212         throws com.liferay.portal.SystemException;
213 
214     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215     public java.util.List<com.liferay.portal.model.Organization> findAll(
216         int start, int end) throws com.liferay.portal.SystemException;
217 
218     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
219     public java.util.List<com.liferay.portal.model.Organization> findAll(
220         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
221         throws com.liferay.portal.SystemException;
222 
223     public void removeByCompanyId(long companyId)
224         throws com.liferay.portal.SystemException;
225 
226     public void removeByLocations(long companyId)
227         throws com.liferay.portal.SystemException;
228 
229     public void removeByC_P(long companyId, long parentOrganizationId)
230         throws com.liferay.portal.SystemException;
231 
232     public void removeByC_N(long companyId, java.lang.String name)
233         throws com.liferay.portal.NoSuchOrganizationException,
234             com.liferay.portal.SystemException;
235 
236     public void removeAll() throws com.liferay.portal.SystemException;
237 
238     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239     public int countByCompanyId(long companyId)
240         throws com.liferay.portal.SystemException;
241 
242     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243     public int countByLocations(long companyId)
244         throws com.liferay.portal.SystemException;
245 
246     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247     public int countByC_P(long companyId, long parentOrganizationId)
248         throws com.liferay.portal.SystemException;
249 
250     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251     public int countByC_N(long companyId, java.lang.String name)
252         throws com.liferay.portal.SystemException;
253 
254     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255     public int countAll() throws com.liferay.portal.SystemException;
256 
257     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
259         throws com.liferay.portal.SystemException;
260 
261     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
263         int start, int end) throws com.liferay.portal.SystemException;
264 
265     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
267         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
268         throws com.liferay.portal.SystemException;
269 
270     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
272 
273     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274     public boolean containsGroup(long pk, long groupPK)
275         throws com.liferay.portal.SystemException;
276 
277     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278     public boolean containsGroups(long pk)
279         throws com.liferay.portal.SystemException;
280 
281     public void addGroup(long pk, long groupPK)
282         throws com.liferay.portal.SystemException;
283 
284     public void addGroup(long pk, com.liferay.portal.model.Group group)
285         throws com.liferay.portal.SystemException;
286 
287     public void addGroups(long pk, long[] groupPKs)
288         throws com.liferay.portal.SystemException;
289 
290     public void addGroups(long pk,
291         java.util.List<com.liferay.portal.model.Group> groups)
292         throws com.liferay.portal.SystemException;
293 
294     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
295 
296     public void removeGroup(long pk, long groupPK)
297         throws com.liferay.portal.SystemException;
298 
299     public void removeGroup(long pk, com.liferay.portal.model.Group group)
300         throws com.liferay.portal.SystemException;
301 
302     public void removeGroups(long pk, long[] groupPKs)
303         throws com.liferay.portal.SystemException;
304 
305     public void removeGroups(long pk,
306         java.util.List<com.liferay.portal.model.Group> groups)
307         throws com.liferay.portal.SystemException;
308 
309     public void setGroups(long pk, long[] groupPKs)
310         throws com.liferay.portal.SystemException;
311 
312     public void setGroups(long pk,
313         java.util.List<com.liferay.portal.model.Group> groups)
314         throws com.liferay.portal.SystemException;
315 
316     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
317     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
318         throws com.liferay.portal.SystemException;
319 
320     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
322         int start, int end) throws com.liferay.portal.SystemException;
323 
324     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
326         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
327         throws com.liferay.portal.SystemException;
328 
329     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
331 
332     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
333     public boolean containsUser(long pk, long userPK)
334         throws com.liferay.portal.SystemException;
335 
336     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
337     public boolean containsUsers(long pk)
338         throws com.liferay.portal.SystemException;
339 
340     public void addUser(long pk, long userPK)
341         throws com.liferay.portal.SystemException;
342 
343     public void addUser(long pk, com.liferay.portal.model.User user)
344         throws com.liferay.portal.SystemException;
345 
346     public void addUsers(long pk, long[] userPKs)
347         throws com.liferay.portal.SystemException;
348 
349     public void addUsers(long pk,
350         java.util.List<com.liferay.portal.model.User> users)
351         throws com.liferay.portal.SystemException;
352 
353     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
354 
355     public void removeUser(long pk, long userPK)
356         throws com.liferay.portal.SystemException;
357 
358     public void removeUser(long pk, com.liferay.portal.model.User user)
359         throws com.liferay.portal.SystemException;
360 
361     public void removeUsers(long pk, long[] userPKs)
362         throws com.liferay.portal.SystemException;
363 
364     public void removeUsers(long pk,
365         java.util.List<com.liferay.portal.model.User> users)
366         throws com.liferay.portal.SystemException;
367 
368     public void setUsers(long pk, long[] userPKs)
369         throws com.liferay.portal.SystemException;
370 
371     public void setUsers(long pk,
372         java.util.List<com.liferay.portal.model.User> users)
373         throws com.liferay.portal.SystemException;
374 }