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