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.NoSuchOrganizationException,
36              com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
73              com.liferay.portal.SystemException;
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 start, int end)
83          throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
86          long companyId, int start, 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.NoSuchOrganizationException,
93              com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
98              com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
104             com.liferay.portal.SystemException;
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 start, int end)
111         throws com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.Organization> findByLocations(
114         long companyId, int start, 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.NoSuchOrganizationException,
121             com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
126             com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
132             com.liferay.portal.SystemException;
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 start, 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 start, 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.NoSuchOrganizationException,
151             com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
157             com.liferay.portal.SystemException;
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.NoSuchOrganizationException,
163             com.liferay.portal.SystemException;
164 
165     public com.liferay.portal.model.Organization findByC_N(long companyId,
166         java.lang.String name)
167         throws com.liferay.portal.NoSuchOrganizationException,
168             com.liferay.portal.SystemException;
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<Object> findWithDynamicQuery(
174         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
175         throws com.liferay.portal.SystemException;
176 
177     public java.util.List<Object> findWithDynamicQuery(
178         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
179         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 start, int end) throws com.liferay.portal.SystemException;
186 
187     public java.util.List<com.liferay.portal.model.Organization> findAll(
188         int start, 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.NoSuchOrganizationException,
202             com.liferay.portal.SystemException;
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 
223     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
224         int start, int end) throws com.liferay.portal.SystemException;
225 
226     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
227         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
228         throws com.liferay.portal.SystemException;
229 
230     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
231 
232     public boolean containsGroup(long pk, long groupPK)
233         throws com.liferay.portal.SystemException;
234 
235     public boolean containsGroups(long pk)
236         throws com.liferay.portal.SystemException;
237 
238     public void addGroup(long pk, long groupPK)
239         throws com.liferay.portal.SystemException;
240 
241     public void addGroup(long pk, com.liferay.portal.model.Group group)
242         throws com.liferay.portal.SystemException;
243 
244     public void addGroups(long pk, long[] groupPKs)
245         throws com.liferay.portal.SystemException;
246 
247     public void addGroups(long pk,
248         java.util.List<com.liferay.portal.model.Group> groups)
249         throws com.liferay.portal.SystemException;
250 
251     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
252 
253     public void removeGroup(long pk, long groupPK)
254         throws com.liferay.portal.SystemException;
255 
256     public void removeGroup(long pk, com.liferay.portal.model.Group group)
257         throws com.liferay.portal.SystemException;
258 
259     public void removeGroups(long pk, long[] groupPKs)
260         throws com.liferay.portal.SystemException;
261 
262     public void removeGroups(long pk,
263         java.util.List<com.liferay.portal.model.Group> groups)
264         throws com.liferay.portal.SystemException;
265 
266     public void setGroups(long pk, long[] groupPKs)
267         throws com.liferay.portal.SystemException;
268 
269     public void setGroups(long pk,
270         java.util.List<com.liferay.portal.model.Group> groups)
271         throws com.liferay.portal.SystemException;
272 
273     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
274         throws com.liferay.portal.SystemException;
275 
276     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
277         int start, int end) throws com.liferay.portal.SystemException;
278 
279     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
280         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
281         throws com.liferay.portal.SystemException;
282 
283     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
284 
285     public boolean containsUser(long pk, long userPK)
286         throws com.liferay.portal.SystemException;
287 
288     public boolean containsUsers(long pk)
289         throws com.liferay.portal.SystemException;
290 
291     public void addUser(long pk, long userPK)
292         throws com.liferay.portal.SystemException;
293 
294     public void addUser(long pk, com.liferay.portal.model.User user)
295         throws com.liferay.portal.SystemException;
296 
297     public void addUsers(long pk, long[] userPKs)
298         throws com.liferay.portal.SystemException;
299 
300     public void addUsers(long pk,
301         java.util.List<com.liferay.portal.model.User> users)
302         throws com.liferay.portal.SystemException;
303 
304     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
305 
306     public void removeUser(long pk, long userPK)
307         throws com.liferay.portal.SystemException;
308 
309     public void removeUser(long pk, com.liferay.portal.model.User user)
310         throws com.liferay.portal.SystemException;
311 
312     public void removeUsers(long pk, long[] userPKs)
313         throws com.liferay.portal.SystemException;
314 
315     public void removeUsers(long pk,
316         java.util.List<com.liferay.portal.model.User> users)
317         throws com.liferay.portal.SystemException;
318 
319     public void setUsers(long pk, long[] userPKs)
320         throws com.liferay.portal.SystemException;
321 
322     public void setUsers(long pk,
323         java.util.List<com.liferay.portal.model.User> users)
324         throws com.liferay.portal.SystemException;
325 
326     public void registerListener(
327         com.liferay.portal.model.ModelListener listener);
328 
329     public void unregisterListener(
330         com.liferay.portal.model.ModelListener listener);
331 }