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