001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.model.Organization;
019    
020    /**
021     * The persistence interface for the organization service.
022     *
023     * <p>
024     * Caching information and settings can be found in <code>portal.properties</code>
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see OrganizationPersistenceImpl
029     * @see OrganizationUtil
030     * @generated
031     */
032    public interface OrganizationPersistence extends BasePersistence<Organization> {
033            /*
034             * NOTE FOR DEVELOPERS:
035             *
036             * Never modify or reference this interface directly. Always use {@link OrganizationUtil} to access the organization persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
037             */
038    
039            /**
040            * Caches the organization in the entity cache if it is enabled.
041            *
042            * @param organization the organization to cache
043            */
044            public void cacheResult(com.liferay.portal.model.Organization organization);
045    
046            /**
047            * Caches the organizations in the entity cache if it is enabled.
048            *
049            * @param organizations the organizations to cache
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portal.model.Organization> organizations);
053    
054            /**
055            * Creates a new organization with the primary key. Does not add the organization to the database.
056            *
057            * @param organizationId the primary key for the new organization
058            * @return the new organization
059            */
060            public com.liferay.portal.model.Organization create(long organizationId);
061    
062            /**
063            * Removes the organization with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param organizationId the primary key of the organization to remove
066            * @return the organization that was removed
067            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public com.liferay.portal.model.Organization remove(long organizationId)
071                    throws com.liferay.portal.NoSuchOrganizationException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            public com.liferay.portal.model.Organization updateImpl(
075                    com.liferay.portal.model.Organization organization, boolean merge)
076                    throws com.liferay.portal.kernel.exception.SystemException;
077    
078            /**
079            * Finds the organization with the primary key or throws a {@link com.liferay.portal.NoSuchOrganizationException} if it could not be found.
080            *
081            * @param organizationId the primary key of the organization to find
082            * @return the organization
083            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portal.model.Organization findByPrimaryKey(
087                    long organizationId)
088                    throws com.liferay.portal.NoSuchOrganizationException,
089                            com.liferay.portal.kernel.exception.SystemException;
090    
091            /**
092            * Finds the organization with the primary key or returns <code>null</code> if it could not be found.
093            *
094            * @param organizationId the primary key of the organization to find
095            * @return the organization, or <code>null</code> if a organization with the primary key could not be found
096            * @throws SystemException if a system exception occurred
097            */
098            public com.liferay.portal.model.Organization fetchByPrimaryKey(
099                    long organizationId)
100                    throws com.liferay.portal.kernel.exception.SystemException;
101    
102            /**
103            * Finds all the organizations where companyId = &#63;.
104            *
105            * @param companyId the company ID to search with
106            * @return the matching organizations
107            * @throws SystemException if a system exception occurred
108            */
109            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
110                    long companyId)
111                    throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Finds a range of all the organizations where companyId = &#63;.
115            *
116            * <p>
117            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
118            * </p>
119            *
120            * @param companyId the company ID to search with
121            * @param start the lower bound of the range of organizations to return
122            * @param end the upper bound of the range of organizations to return (not inclusive)
123            * @return the range of matching organizations
124            * @throws SystemException if a system exception occurred
125            */
126            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
127                    long companyId, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Finds an ordered range of all the organizations where companyId = &#63;.
132            *
133            * <p>
134            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
135            * </p>
136            *
137            * @param companyId the company ID to search with
138            * @param start the lower bound of the range of organizations to return
139            * @param end the upper bound of the range of organizations to return (not inclusive)
140            * @param orderByComparator the comparator to order the results by
141            * @return the ordered range of matching organizations
142            * @throws SystemException if a system exception occurred
143            */
144            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
145                    long companyId, int start, int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Finds the first organization in the ordered set where companyId = &#63;.
151            *
152            * <p>
153            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
154            * </p>
155            *
156            * @param companyId the company ID to search with
157            * @param orderByComparator the comparator to order the set by
158            * @return the first matching organization
159            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.Organization findByCompanyId_First(
163                    long companyId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.NoSuchOrganizationException,
166                            com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Finds the last organization in the ordered set where companyId = &#63;.
170            *
171            * <p>
172            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
173            * </p>
174            *
175            * @param companyId the company ID to search with
176            * @param orderByComparator the comparator to order the set by
177            * @return the last matching organization
178            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public com.liferay.portal.model.Organization findByCompanyId_Last(
182                    long companyId,
183                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184                    throws com.liferay.portal.NoSuchOrganizationException,
185                            com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63;.
189            *
190            * <p>
191            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
192            * </p>
193            *
194            * @param organizationId the primary key of the current organization
195            * @param companyId the company ID to search with
196            * @param orderByComparator the comparator to order the set by
197            * @return the previous, current, and next organization
198            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
202                    long organizationId, long companyId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.NoSuchOrganizationException,
205                            com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Filters by the user's permissions and finds all the organizations where companyId = &#63;.
209            *
210            * @param companyId the company ID to search with
211            * @return the matching organizations that the user has permission to view
212            * @throws SystemException if a system exception occurred
213            */
214            public java.util.List<com.liferay.portal.model.Organization> filterFindByCompanyId(
215                    long companyId)
216                    throws com.liferay.portal.kernel.exception.SystemException;
217    
218            /**
219            * Filters by the user's permissions and finds a range of all the organizations where companyId = &#63;.
220            *
221            * <p>
222            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
223            * </p>
224            *
225            * @param companyId the company ID to search with
226            * @param start the lower bound of the range of organizations to return
227            * @param end the upper bound of the range of organizations to return (not inclusive)
228            * @return the range of matching organizations that the user has permission to view
229            * @throws SystemException if a system exception occurred
230            */
231            public java.util.List<com.liferay.portal.model.Organization> filterFindByCompanyId(
232                    long companyId, int start, int end)
233                    throws com.liferay.portal.kernel.exception.SystemException;
234    
235            /**
236            * Filters by the user's permissions and finds an ordered range of all the organizations where companyId = &#63;.
237            *
238            * <p>
239            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
240            * </p>
241            *
242            * @param companyId the company ID to search with
243            * @param start the lower bound of the range of organizations to return
244            * @param end the upper bound of the range of organizations to return (not inclusive)
245            * @param orderByComparator the comparator to order the results by
246            * @return the ordered range of matching organizations that the user has permission to view
247            * @throws SystemException if a system exception occurred
248            */
249            public java.util.List<com.liferay.portal.model.Organization> filterFindByCompanyId(
250                    long companyId, int start, int end,
251                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
252                    throws com.liferay.portal.kernel.exception.SystemException;
253    
254            /**
255            * Filters the organizations before and after the current organization in the ordered set where companyId = &#63;.
256            *
257            * <p>
258            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
259            * </p>
260            *
261            * @param organizationId the primary key of the current organization
262            * @param companyId the company ID to search with
263            * @param orderByComparator the comparator to order the set by
264            * @return the previous, current, and next organization
265            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
266            * @throws SystemException if a system exception occurred
267            */
268            public com.liferay.portal.model.Organization[] filterFindByCompanyId_PrevAndNext(
269                    long organizationId, long companyId,
270                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
271                    throws com.liferay.portal.NoSuchOrganizationException,
272                            com.liferay.portal.kernel.exception.SystemException;
273    
274            /**
275            * Finds all the organizations where companyId = &#63;.
276            *
277            * @param companyId the company ID to search with
278            * @return the matching organizations
279            * @throws SystemException if a system exception occurred
280            */
281            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
282                    long companyId)
283                    throws com.liferay.portal.kernel.exception.SystemException;
284    
285            /**
286            * Finds a range of all the organizations where companyId = &#63;.
287            *
288            * <p>
289            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
290            * </p>
291            *
292            * @param companyId the company ID to search with
293            * @param start the lower bound of the range of organizations to return
294            * @param end the upper bound of the range of organizations to return (not inclusive)
295            * @return the range of matching organizations
296            * @throws SystemException if a system exception occurred
297            */
298            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
299                    long companyId, int start, int end)
300                    throws com.liferay.portal.kernel.exception.SystemException;
301    
302            /**
303            * Finds an ordered range of all the organizations where companyId = &#63;.
304            *
305            * <p>
306            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
307            * </p>
308            *
309            * @param companyId the company ID to search with
310            * @param start the lower bound of the range of organizations to return
311            * @param end the upper bound of the range of organizations to return (not inclusive)
312            * @param orderByComparator the comparator to order the results by
313            * @return the ordered range of matching organizations
314            * @throws SystemException if a system exception occurred
315            */
316            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
317                    long companyId, int start, int end,
318                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
319                    throws com.liferay.portal.kernel.exception.SystemException;
320    
321            /**
322            * Finds the first organization in the ordered set where companyId = &#63;.
323            *
324            * <p>
325            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
326            * </p>
327            *
328            * @param companyId the company ID to search with
329            * @param orderByComparator the comparator to order the set by
330            * @return the first matching organization
331            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public com.liferay.portal.model.Organization findByLocations_First(
335                    long companyId,
336                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
337                    throws com.liferay.portal.NoSuchOrganizationException,
338                            com.liferay.portal.kernel.exception.SystemException;
339    
340            /**
341            * Finds the last organization in the ordered set where companyId = &#63;.
342            *
343            * <p>
344            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
345            * </p>
346            *
347            * @param companyId the company ID to search with
348            * @param orderByComparator the comparator to order the set by
349            * @return the last matching organization
350            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
351            * @throws SystemException if a system exception occurred
352            */
353            public com.liferay.portal.model.Organization findByLocations_Last(
354                    long companyId,
355                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
356                    throws com.liferay.portal.NoSuchOrganizationException,
357                            com.liferay.portal.kernel.exception.SystemException;
358    
359            /**
360            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63;.
361            *
362            * <p>
363            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
364            * </p>
365            *
366            * @param organizationId the primary key of the current organization
367            * @param companyId the company ID to search with
368            * @param orderByComparator the comparator to order the set by
369            * @return the previous, current, and next organization
370            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
371            * @throws SystemException if a system exception occurred
372            */
373            public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
374                    long organizationId, long companyId,
375                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
376                    throws com.liferay.portal.NoSuchOrganizationException,
377                            com.liferay.portal.kernel.exception.SystemException;
378    
379            /**
380            * Filters by the user's permissions and finds all the organizations where companyId = &#63;.
381            *
382            * @param companyId the company ID to search with
383            * @return the matching organizations that the user has permission to view
384            * @throws SystemException if a system exception occurred
385            */
386            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
387                    long companyId)
388                    throws com.liferay.portal.kernel.exception.SystemException;
389    
390            /**
391            * Filters by the user's permissions and finds a range of all the organizations where companyId = &#63;.
392            *
393            * <p>
394            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
395            * </p>
396            *
397            * @param companyId the company ID to search with
398            * @param start the lower bound of the range of organizations to return
399            * @param end the upper bound of the range of organizations to return (not inclusive)
400            * @return the range of matching organizations that the user has permission to view
401            * @throws SystemException if a system exception occurred
402            */
403            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
404                    long companyId, int start, int end)
405                    throws com.liferay.portal.kernel.exception.SystemException;
406    
407            /**
408            * Filters by the user's permissions and finds an ordered range of all the organizations where companyId = &#63;.
409            *
410            * <p>
411            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
412            * </p>
413            *
414            * @param companyId the company ID to search with
415            * @param start the lower bound of the range of organizations to return
416            * @param end the upper bound of the range of organizations to return (not inclusive)
417            * @param orderByComparator the comparator to order the results by
418            * @return the ordered range of matching organizations that the user has permission to view
419            * @throws SystemException if a system exception occurred
420            */
421            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
422                    long companyId, int start, int end,
423                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
424                    throws com.liferay.portal.kernel.exception.SystemException;
425    
426            /**
427            * Filters the organizations before and after the current organization in the ordered set where companyId = &#63;.
428            *
429            * <p>
430            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
431            * </p>
432            *
433            * @param organizationId the primary key of the current organization
434            * @param companyId the company ID to search with
435            * @param orderByComparator the comparator to order the set by
436            * @return the previous, current, and next organization
437            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
438            * @throws SystemException if a system exception occurred
439            */
440            public com.liferay.portal.model.Organization[] filterFindByLocations_PrevAndNext(
441                    long organizationId, long companyId,
442                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
443                    throws com.liferay.portal.NoSuchOrganizationException,
444                            com.liferay.portal.kernel.exception.SystemException;
445    
446            /**
447            * Finds all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
448            *
449            * @param companyId the company ID to search with
450            * @param parentOrganizationId the parent organization ID to search with
451            * @return the matching organizations
452            * @throws SystemException if a system exception occurred
453            */
454            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
455                    long companyId, long parentOrganizationId)
456                    throws com.liferay.portal.kernel.exception.SystemException;
457    
458            /**
459            * Finds a range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
460            *
461            * <p>
462            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
463            * </p>
464            *
465            * @param companyId the company ID to search with
466            * @param parentOrganizationId the parent organization ID to search with
467            * @param start the lower bound of the range of organizations to return
468            * @param end the upper bound of the range of organizations to return (not inclusive)
469            * @return the range of matching organizations
470            * @throws SystemException if a system exception occurred
471            */
472            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
473                    long companyId, long parentOrganizationId, int start, int end)
474                    throws com.liferay.portal.kernel.exception.SystemException;
475    
476            /**
477            * Finds an ordered range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
478            *
479            * <p>
480            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
481            * </p>
482            *
483            * @param companyId the company ID to search with
484            * @param parentOrganizationId the parent organization ID to search with
485            * @param start the lower bound of the range of organizations to return
486            * @param end the upper bound of the range of organizations to return (not inclusive)
487            * @param orderByComparator the comparator to order the results by
488            * @return the ordered range of matching organizations
489            * @throws SystemException if a system exception occurred
490            */
491            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
492                    long companyId, long parentOrganizationId, int start, int end,
493                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
494                    throws com.liferay.portal.kernel.exception.SystemException;
495    
496            /**
497            * Finds the first organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
498            *
499            * <p>
500            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
501            * </p>
502            *
503            * @param companyId the company ID to search with
504            * @param parentOrganizationId the parent organization ID to search with
505            * @param orderByComparator the comparator to order the set by
506            * @return the first matching organization
507            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
508            * @throws SystemException if a system exception occurred
509            */
510            public com.liferay.portal.model.Organization findByC_P_First(
511                    long companyId, long parentOrganizationId,
512                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
513                    throws com.liferay.portal.NoSuchOrganizationException,
514                            com.liferay.portal.kernel.exception.SystemException;
515    
516            /**
517            * Finds the last organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
518            *
519            * <p>
520            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
521            * </p>
522            *
523            * @param companyId the company ID to search with
524            * @param parentOrganizationId the parent organization ID to search with
525            * @param orderByComparator the comparator to order the set by
526            * @return the last matching organization
527            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
528            * @throws SystemException if a system exception occurred
529            */
530            public com.liferay.portal.model.Organization findByC_P_Last(
531                    long companyId, long parentOrganizationId,
532                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
533                    throws com.liferay.portal.NoSuchOrganizationException,
534                            com.liferay.portal.kernel.exception.SystemException;
535    
536            /**
537            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
538            *
539            * <p>
540            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
541            * </p>
542            *
543            * @param organizationId the primary key of the current organization
544            * @param companyId the company ID to search with
545            * @param parentOrganizationId the parent organization ID to search with
546            * @param orderByComparator the comparator to order the set by
547            * @return the previous, current, and next organization
548            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
549            * @throws SystemException if a system exception occurred
550            */
551            public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
552                    long organizationId, long companyId, long parentOrganizationId,
553                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
554                    throws com.liferay.portal.NoSuchOrganizationException,
555                            com.liferay.portal.kernel.exception.SystemException;
556    
557            /**
558            * Filters by the user's permissions and finds all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
559            *
560            * @param companyId the company ID to search with
561            * @param parentOrganizationId the parent organization ID to search with
562            * @return the matching organizations that the user has permission to view
563            * @throws SystemException if a system exception occurred
564            */
565            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
566                    long companyId, long parentOrganizationId)
567                    throws com.liferay.portal.kernel.exception.SystemException;
568    
569            /**
570            * Filters by the user's permissions and finds a range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
571            *
572            * <p>
573            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
574            * </p>
575            *
576            * @param companyId the company ID to search with
577            * @param parentOrganizationId the parent organization ID to search with
578            * @param start the lower bound of the range of organizations to return
579            * @param end the upper bound of the range of organizations to return (not inclusive)
580            * @return the range of matching organizations that the user has permission to view
581            * @throws SystemException if a system exception occurred
582            */
583            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
584                    long companyId, long parentOrganizationId, int start, int end)
585                    throws com.liferay.portal.kernel.exception.SystemException;
586    
587            /**
588            * Filters by the user's permissions and finds an ordered range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
589            *
590            * <p>
591            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
592            * </p>
593            *
594            * @param companyId the company ID to search with
595            * @param parentOrganizationId the parent organization ID to search with
596            * @param start the lower bound of the range of organizations to return
597            * @param end the upper bound of the range of organizations to return (not inclusive)
598            * @param orderByComparator the comparator to order the results by
599            * @return the ordered range of matching organizations that the user has permission to view
600            * @throws SystemException if a system exception occurred
601            */
602            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
603                    long companyId, long parentOrganizationId, int start, int end,
604                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
605                    throws com.liferay.portal.kernel.exception.SystemException;
606    
607            /**
608            * Filters the organizations before and after the current organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
609            *
610            * <p>
611            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
612            * </p>
613            *
614            * @param organizationId the primary key of the current organization
615            * @param companyId the company ID to search with
616            * @param parentOrganizationId the parent organization ID to search with
617            * @param orderByComparator the comparator to order the set by
618            * @return the previous, current, and next organization
619            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
620            * @throws SystemException if a system exception occurred
621            */
622            public com.liferay.portal.model.Organization[] filterFindByC_P_PrevAndNext(
623                    long organizationId, long companyId, long parentOrganizationId,
624                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
625                    throws com.liferay.portal.NoSuchOrganizationException,
626                            com.liferay.portal.kernel.exception.SystemException;
627    
628            /**
629            * Finds the organization where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchOrganizationException} if it could not be found.
630            *
631            * @param companyId the company ID to search with
632            * @param name the name to search with
633            * @return the matching organization
634            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
635            * @throws SystemException if a system exception occurred
636            */
637            public com.liferay.portal.model.Organization findByC_N(long companyId,
638                    java.lang.String name)
639                    throws com.liferay.portal.NoSuchOrganizationException,
640                            com.liferay.portal.kernel.exception.SystemException;
641    
642            /**
643            * Finds the organization where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
644            *
645            * @param companyId the company ID to search with
646            * @param name the name to search with
647            * @return the matching organization, or <code>null</code> if a matching organization could not be found
648            * @throws SystemException if a system exception occurred
649            */
650            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
651                    java.lang.String name)
652                    throws com.liferay.portal.kernel.exception.SystemException;
653    
654            /**
655            * Finds the organization where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
656            *
657            * @param companyId the company ID to search with
658            * @param name the name to search with
659            * @return the matching organization, or <code>null</code> if a matching organization could not be found
660            * @throws SystemException if a system exception occurred
661            */
662            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
663                    java.lang.String name, boolean retrieveFromCache)
664                    throws com.liferay.portal.kernel.exception.SystemException;
665    
666            /**
667            * Finds all the organizations.
668            *
669            * @return the organizations
670            * @throws SystemException if a system exception occurred
671            */
672            public java.util.List<com.liferay.portal.model.Organization> findAll()
673                    throws com.liferay.portal.kernel.exception.SystemException;
674    
675            /**
676            * Finds a range of all the organizations.
677            *
678            * <p>
679            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
680            * </p>
681            *
682            * @param start the lower bound of the range of organizations to return
683            * @param end the upper bound of the range of organizations to return (not inclusive)
684            * @return the range of organizations
685            * @throws SystemException if a system exception occurred
686            */
687            public java.util.List<com.liferay.portal.model.Organization> findAll(
688                    int start, int end)
689                    throws com.liferay.portal.kernel.exception.SystemException;
690    
691            /**
692            * Finds an ordered range of all the organizations.
693            *
694            * <p>
695            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
696            * </p>
697            *
698            * @param start the lower bound of the range of organizations to return
699            * @param end the upper bound of the range of organizations to return (not inclusive)
700            * @param orderByComparator the comparator to order the results by
701            * @return the ordered range of organizations
702            * @throws SystemException if a system exception occurred
703            */
704            public java.util.List<com.liferay.portal.model.Organization> findAll(
705                    int start, int end,
706                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
707                    throws com.liferay.portal.kernel.exception.SystemException;
708    
709            /**
710            * Removes all the organizations where companyId = &#63; from the database.
711            *
712            * @param companyId the company ID to search with
713            * @throws SystemException if a system exception occurred
714            */
715            public void removeByCompanyId(long companyId)
716                    throws com.liferay.portal.kernel.exception.SystemException;
717    
718            /**
719            * Removes all the organizations where companyId = &#63; from the database.
720            *
721            * @param companyId the company ID to search with
722            * @throws SystemException if a system exception occurred
723            */
724            public void removeByLocations(long companyId)
725                    throws com.liferay.portal.kernel.exception.SystemException;
726    
727            /**
728            * Removes all the organizations where companyId = &#63; and parentOrganizationId = &#63; from the database.
729            *
730            * @param companyId the company ID to search with
731            * @param parentOrganizationId the parent organization ID to search with
732            * @throws SystemException if a system exception occurred
733            */
734            public void removeByC_P(long companyId, long parentOrganizationId)
735                    throws com.liferay.portal.kernel.exception.SystemException;
736    
737            /**
738            * Removes the organization where companyId = &#63; and name = &#63; from the database.
739            *
740            * @param companyId the company ID to search with
741            * @param name the name to search with
742            * @throws SystemException if a system exception occurred
743            */
744            public void removeByC_N(long companyId, java.lang.String name)
745                    throws com.liferay.portal.NoSuchOrganizationException,
746                            com.liferay.portal.kernel.exception.SystemException;
747    
748            /**
749            * Removes all the organizations from the database.
750            *
751            * @throws SystemException if a system exception occurred
752            */
753            public void removeAll()
754                    throws com.liferay.portal.kernel.exception.SystemException;
755    
756            /**
757            * Counts all the organizations where companyId = &#63;.
758            *
759            * @param companyId the company ID to search with
760            * @return the number of matching organizations
761            * @throws SystemException if a system exception occurred
762            */
763            public int countByCompanyId(long companyId)
764                    throws com.liferay.portal.kernel.exception.SystemException;
765    
766            /**
767            * Filters by the user's permissions and counts all the organizations where companyId = &#63;.
768            *
769            * @param companyId the company ID to search with
770            * @return the number of matching organizations that the user has permission to view
771            * @throws SystemException if a system exception occurred
772            */
773            public int filterCountByCompanyId(long companyId)
774                    throws com.liferay.portal.kernel.exception.SystemException;
775    
776            /**
777            * Counts all the organizations where companyId = &#63;.
778            *
779            * @param companyId the company ID to search with
780            * @return the number of matching organizations
781            * @throws SystemException if a system exception occurred
782            */
783            public int countByLocations(long companyId)
784                    throws com.liferay.portal.kernel.exception.SystemException;
785    
786            /**
787            * Filters by the user's permissions and counts all the organizations where companyId = &#63;.
788            *
789            * @param companyId the company ID to search with
790            * @return the number of matching organizations that the user has permission to view
791            * @throws SystemException if a system exception occurred
792            */
793            public int filterCountByLocations(long companyId)
794                    throws com.liferay.portal.kernel.exception.SystemException;
795    
796            /**
797            * Counts all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
798            *
799            * @param companyId the company ID to search with
800            * @param parentOrganizationId the parent organization ID to search with
801            * @return the number of matching organizations
802            * @throws SystemException if a system exception occurred
803            */
804            public int countByC_P(long companyId, long parentOrganizationId)
805                    throws com.liferay.portal.kernel.exception.SystemException;
806    
807            /**
808            * Filters by the user's permissions and counts all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
809            *
810            * @param companyId the company ID to search with
811            * @param parentOrganizationId the parent organization ID to search with
812            * @return the number of matching organizations that the user has permission to view
813            * @throws SystemException if a system exception occurred
814            */
815            public int filterCountByC_P(long companyId, long parentOrganizationId)
816                    throws com.liferay.portal.kernel.exception.SystemException;
817    
818            /**
819            * Counts all the organizations where companyId = &#63; and name = &#63;.
820            *
821            * @param companyId the company ID to search with
822            * @param name the name to search with
823            * @return the number of matching organizations
824            * @throws SystemException if a system exception occurred
825            */
826            public int countByC_N(long companyId, java.lang.String name)
827                    throws com.liferay.portal.kernel.exception.SystemException;
828    
829            /**
830            * Counts all the organizations.
831            *
832            * @return the number of organizations
833            * @throws SystemException if a system exception occurred
834            */
835            public int countAll()
836                    throws com.liferay.portal.kernel.exception.SystemException;
837    
838            /**
839            * Gets all the groups associated with the organization.
840            *
841            * @param pk the primary key of the organization to get the associated groups for
842            * @return the groups associated with the organization
843            * @throws SystemException if a system exception occurred
844            */
845            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
846                    throws com.liferay.portal.kernel.exception.SystemException;
847    
848            /**
849            * Gets a range of all the groups associated with the organization.
850            *
851            * <p>
852            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
853            * </p>
854            *
855            * @param pk the primary key of the organization to get the associated groups for
856            * @param start the lower bound of the range of organizations to return
857            * @param end the upper bound of the range of organizations to return (not inclusive)
858            * @return the range of groups associated with the organization
859            * @throws SystemException if a system exception occurred
860            */
861            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
862                    int start, int end)
863                    throws com.liferay.portal.kernel.exception.SystemException;
864    
865            /**
866            * Gets an ordered range of all the groups associated with the organization.
867            *
868            * <p>
869            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
870            * </p>
871            *
872            * @param pk the primary key of the organization to get the associated groups for
873            * @param start the lower bound of the range of organizations to return
874            * @param end the upper bound of the range of organizations to return (not inclusive)
875            * @param orderByComparator the comparator to order the results by
876            * @return the ordered range of groups associated with the organization
877            * @throws SystemException if a system exception occurred
878            */
879            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
880                    int start, int end,
881                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
882                    throws com.liferay.portal.kernel.exception.SystemException;
883    
884            /**
885            * Gets the number of groups associated with the organization.
886            *
887            * @param pk the primary key of the organization to get the number of associated groups for
888            * @return the number of groups associated with the organization
889            * @throws SystemException if a system exception occurred
890            */
891            public int getGroupsSize(long pk)
892                    throws com.liferay.portal.kernel.exception.SystemException;
893    
894            /**
895            * Determines if the group is associated with the organization.
896            *
897            * @param pk the primary key of the organization
898            * @param groupPK the primary key of the group
899            * @return <code>true</code> if the group is associated with the organization; <code>false</code> otherwise
900            * @throws SystemException if a system exception occurred
901            */
902            public boolean containsGroup(long pk, long groupPK)
903                    throws com.liferay.portal.kernel.exception.SystemException;
904    
905            /**
906            * Determines if the organization has any groups associated with it.
907            *
908            * @param pk the primary key of the organization to check for associations with groups
909            * @return <code>true</code> if the organization has any groups associated with it; <code>false</code> otherwise
910            * @throws SystemException if a system exception occurred
911            */
912            public boolean containsGroups(long pk)
913                    throws com.liferay.portal.kernel.exception.SystemException;
914    
915            /**
916            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
917            *
918            * @param pk the primary key of the organization
919            * @param groupPK the primary key of the group
920            * @throws SystemException if a system exception occurred
921            */
922            public void addGroup(long pk, long groupPK)
923                    throws com.liferay.portal.kernel.exception.SystemException;
924    
925            /**
926            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
927            *
928            * @param pk the primary key of the organization
929            * @param group the group
930            * @throws SystemException if a system exception occurred
931            */
932            public void addGroup(long pk, com.liferay.portal.model.Group group)
933                    throws com.liferay.portal.kernel.exception.SystemException;
934    
935            /**
936            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
937            *
938            * @param pk the primary key of the organization
939            * @param groupPKs the primary keys of the groups
940            * @throws SystemException if a system exception occurred
941            */
942            public void addGroups(long pk, long[] groupPKs)
943                    throws com.liferay.portal.kernel.exception.SystemException;
944    
945            /**
946            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
947            *
948            * @param pk the primary key of the organization
949            * @param groups the groups
950            * @throws SystemException if a system exception occurred
951            */
952            public void addGroups(long pk,
953                    java.util.List<com.liferay.portal.model.Group> groups)
954                    throws com.liferay.portal.kernel.exception.SystemException;
955    
956            /**
957            * Clears all associations between the organization and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
958            *
959            * @param pk the primary key of the organization to clear the associated groups from
960            * @throws SystemException if a system exception occurred
961            */
962            public void clearGroups(long pk)
963                    throws com.liferay.portal.kernel.exception.SystemException;
964    
965            /**
966            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
967            *
968            * @param pk the primary key of the organization
969            * @param groupPK the primary key of the group
970            * @throws SystemException if a system exception occurred
971            */
972            public void removeGroup(long pk, long groupPK)
973                    throws com.liferay.portal.kernel.exception.SystemException;
974    
975            /**
976            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
977            *
978            * @param pk the primary key of the organization
979            * @param group the group
980            * @throws SystemException if a system exception occurred
981            */
982            public void removeGroup(long pk, com.liferay.portal.model.Group group)
983                    throws com.liferay.portal.kernel.exception.SystemException;
984    
985            /**
986            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
987            *
988            * @param pk the primary key of the organization
989            * @param groupPKs the primary keys of the groups
990            * @throws SystemException if a system exception occurred
991            */
992            public void removeGroups(long pk, long[] groupPKs)
993                    throws com.liferay.portal.kernel.exception.SystemException;
994    
995            /**
996            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
997            *
998            * @param pk the primary key of the organization
999            * @param groups the groups
1000            * @throws SystemException if a system exception occurred
1001            */
1002            public void removeGroups(long pk,
1003                    java.util.List<com.liferay.portal.model.Group> groups)
1004                    throws com.liferay.portal.kernel.exception.SystemException;
1005    
1006            /**
1007            * Sets the groups associated with the organization, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1008            *
1009            * @param pk the primary key of the organization to set the associations for
1010            * @param groupPKs the primary keys of the groups to be associated with the organization
1011            * @throws SystemException if a system exception occurred
1012            */
1013            public void setGroups(long pk, long[] groupPKs)
1014                    throws com.liferay.portal.kernel.exception.SystemException;
1015    
1016            /**
1017            * Sets the groups associated with the organization, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1018            *
1019            * @param pk the primary key of the organization to set the associations for
1020            * @param groups the groups to be associated with the organization
1021            * @throws SystemException if a system exception occurred
1022            */
1023            public void setGroups(long pk,
1024                    java.util.List<com.liferay.portal.model.Group> groups)
1025                    throws com.liferay.portal.kernel.exception.SystemException;
1026    
1027            /**
1028            * Gets all the users associated with the organization.
1029            *
1030            * @param pk the primary key of the organization to get the associated users for
1031            * @return the users associated with the organization
1032            * @throws SystemException if a system exception occurred
1033            */
1034            public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
1035                    throws com.liferay.portal.kernel.exception.SystemException;
1036    
1037            /**
1038            * Gets a range of all the users associated with the organization.
1039            *
1040            * <p>
1041            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1042            * </p>
1043            *
1044            * @param pk the primary key of the organization to get the associated users for
1045            * @param start the lower bound of the range of organizations to return
1046            * @param end the upper bound of the range of organizations to return (not inclusive)
1047            * @return the range of users associated with the organization
1048            * @throws SystemException if a system exception occurred
1049            */
1050            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
1051                    int start, int end)
1052                    throws com.liferay.portal.kernel.exception.SystemException;
1053    
1054            /**
1055            * Gets an ordered range of all the users associated with the organization.
1056            *
1057            * <p>
1058            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1059            * </p>
1060            *
1061            * @param pk the primary key of the organization to get the associated users for
1062            * @param start the lower bound of the range of organizations to return
1063            * @param end the upper bound of the range of organizations to return (not inclusive)
1064            * @param orderByComparator the comparator to order the results by
1065            * @return the ordered range of users associated with the organization
1066            * @throws SystemException if a system exception occurred
1067            */
1068            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
1069                    int start, int end,
1070                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1071                    throws com.liferay.portal.kernel.exception.SystemException;
1072    
1073            /**
1074            * Gets the number of users associated with the organization.
1075            *
1076            * @param pk the primary key of the organization to get the number of associated users for
1077            * @return the number of users associated with the organization
1078            * @throws SystemException if a system exception occurred
1079            */
1080            public int getUsersSize(long pk)
1081                    throws com.liferay.portal.kernel.exception.SystemException;
1082    
1083            /**
1084            * Determines if the user is associated with the organization.
1085            *
1086            * @param pk the primary key of the organization
1087            * @param userPK the primary key of the user
1088            * @return <code>true</code> if the user is associated with the organization; <code>false</code> otherwise
1089            * @throws SystemException if a system exception occurred
1090            */
1091            public boolean containsUser(long pk, long userPK)
1092                    throws com.liferay.portal.kernel.exception.SystemException;
1093    
1094            /**
1095            * Determines if the organization has any users associated with it.
1096            *
1097            * @param pk the primary key of the organization to check for associations with users
1098            * @return <code>true</code> if the organization has any users associated with it; <code>false</code> otherwise
1099            * @throws SystemException if a system exception occurred
1100            */
1101            public boolean containsUsers(long pk)
1102                    throws com.liferay.portal.kernel.exception.SystemException;
1103    
1104            /**
1105            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1106            *
1107            * @param pk the primary key of the organization
1108            * @param userPK the primary key of the user
1109            * @throws SystemException if a system exception occurred
1110            */
1111            public void addUser(long pk, long userPK)
1112                    throws com.liferay.portal.kernel.exception.SystemException;
1113    
1114            /**
1115            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1116            *
1117            * @param pk the primary key of the organization
1118            * @param user the user
1119            * @throws SystemException if a system exception occurred
1120            */
1121            public void addUser(long pk, com.liferay.portal.model.User user)
1122                    throws com.liferay.portal.kernel.exception.SystemException;
1123    
1124            /**
1125            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1126            *
1127            * @param pk the primary key of the organization
1128            * @param userPKs the primary keys of the users
1129            * @throws SystemException if a system exception occurred
1130            */
1131            public void addUsers(long pk, long[] userPKs)
1132                    throws com.liferay.portal.kernel.exception.SystemException;
1133    
1134            /**
1135            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1136            *
1137            * @param pk the primary key of the organization
1138            * @param users the users
1139            * @throws SystemException if a system exception occurred
1140            */
1141            public void addUsers(long pk,
1142                    java.util.List<com.liferay.portal.model.User> users)
1143                    throws com.liferay.portal.kernel.exception.SystemException;
1144    
1145            /**
1146            * Clears all associations between the organization and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1147            *
1148            * @param pk the primary key of the organization to clear the associated users from
1149            * @throws SystemException if a system exception occurred
1150            */
1151            public void clearUsers(long pk)
1152                    throws com.liferay.portal.kernel.exception.SystemException;
1153    
1154            /**
1155            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1156            *
1157            * @param pk the primary key of the organization
1158            * @param userPK the primary key of the user
1159            * @throws SystemException if a system exception occurred
1160            */
1161            public void removeUser(long pk, long userPK)
1162                    throws com.liferay.portal.kernel.exception.SystemException;
1163    
1164            /**
1165            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1166            *
1167            * @param pk the primary key of the organization
1168            * @param user the user
1169            * @throws SystemException if a system exception occurred
1170            */
1171            public void removeUser(long pk, com.liferay.portal.model.User user)
1172                    throws com.liferay.portal.kernel.exception.SystemException;
1173    
1174            /**
1175            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1176            *
1177            * @param pk the primary key of the organization
1178            * @param userPKs the primary keys of the users
1179            * @throws SystemException if a system exception occurred
1180            */
1181            public void removeUsers(long pk, long[] userPKs)
1182                    throws com.liferay.portal.kernel.exception.SystemException;
1183    
1184            /**
1185            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1186            *
1187            * @param pk the primary key of the organization
1188            * @param users the users
1189            * @throws SystemException if a system exception occurred
1190            */
1191            public void removeUsers(long pk,
1192                    java.util.List<com.liferay.portal.model.User> users)
1193                    throws com.liferay.portal.kernel.exception.SystemException;
1194    
1195            /**
1196            * Sets the users associated with the organization, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1197            *
1198            * @param pk the primary key of the organization to set the associations for
1199            * @param userPKs the primary keys of the users to be associated with the organization
1200            * @throws SystemException if a system exception occurred
1201            */
1202            public void setUsers(long pk, long[] userPKs)
1203                    throws com.liferay.portal.kernel.exception.SystemException;
1204    
1205            /**
1206            * Sets the users associated with the organization, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1207            *
1208            * @param pk the primary key of the organization to set the associations for
1209            * @param users the users to be associated with the organization
1210            * @throws SystemException if a system exception occurred
1211            */
1212            public void setUsers(long pk,
1213                    java.util.List<com.liferay.portal.model.User> users)
1214                    throws com.liferay.portal.kernel.exception.SystemException;
1215    
1216            /**
1217            * Rebuilds the organizations tree for the scope using the modified pre-order tree traversal algorithm.
1218            *
1219            * <p>
1220            * Only call this method if the tree has become stale through operations other than normal CRUD. Under normal circumstances the tree is automatically rebuilt whenver necessary.
1221            * </p>
1222            *
1223            * @param companyId the id of the scope to rebuild the tree for
1224            * @param force whether to force the rebuild even if the tree is not stale
1225            */
1226            public void rebuildTree(long companyId, boolean force)
1227                    throws com.liferay.portal.kernel.exception.SystemException;
1228    
1229            public Organization remove(Organization organization)
1230                    throws SystemException;
1231    }