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