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
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
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
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            * Returns 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
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            * Returns 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
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            * Returns all the organizations where companyId = &#63;.
104            *
105            * @param companyId the company ID
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            * Returns 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
121            * @param start the lower bound of the range of organizations
122            * @param end the upper bound of the range of organizations (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            * Returns 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
138            * @param start the lower bound of the range of organizations
139            * @param end the upper bound of the range of organizations (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * Returns 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
157            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
176            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
196            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns all the organizations that the user has permission to view where companyId = &#63;.
209            *
210            * @param companyId the company ID
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            * Returns a range of all the organizations that the user has permission to view 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
226            * @param start the lower bound of the range of organizations
227            * @param end the upper bound of the range of organizations (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            * Returns an ordered range of all the organizations that the user has permissions to view 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
243            * @param start the lower bound of the range of organizations
244            * @param end the upper bound of the range of organizations (not inclusive)
245            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * 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;.
256            *
257            * @param organizationId the primary key of the current organization
258            * @param companyId the company ID
259            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
260            * @return the previous, current, and next organization
261            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public com.liferay.portal.model.Organization[] filterFindByCompanyId_PrevAndNext(
265                    long organizationId, long companyId,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.NoSuchOrganizationException,
268                            com.liferay.portal.kernel.exception.SystemException;
269    
270            /**
271            * Returns all the organizations where companyId = &#63;.
272            *
273            * @param companyId the company ID
274            * @return the matching organizations
275            * @throws SystemException if a system exception occurred
276            */
277            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
278                    long companyId)
279                    throws com.liferay.portal.kernel.exception.SystemException;
280    
281            /**
282            * Returns a range of all the organizations where companyId = &#63;.
283            *
284            * <p>
285            * 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.
286            * </p>
287            *
288            * @param companyId the company ID
289            * @param start the lower bound of the range of organizations
290            * @param end the upper bound of the range of organizations (not inclusive)
291            * @return the range of matching organizations
292            * @throws SystemException if a system exception occurred
293            */
294            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
295                    long companyId, int start, int end)
296                    throws com.liferay.portal.kernel.exception.SystemException;
297    
298            /**
299            * Returns an ordered range of all the organizations where companyId = &#63;.
300            *
301            * <p>
302            * 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.
303            * </p>
304            *
305            * @param companyId the company ID
306            * @param start the lower bound of the range of organizations
307            * @param end the upper bound of the range of organizations (not inclusive)
308            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
309            * @return the ordered range of matching organizations
310            * @throws SystemException if a system exception occurred
311            */
312            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
313                    long companyId, int start, int end,
314                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
315                    throws com.liferay.portal.kernel.exception.SystemException;
316    
317            /**
318            * Returns the first organization in the ordered set where companyId = &#63;.
319            *
320            * <p>
321            * 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.
322            * </p>
323            *
324            * @param companyId the company ID
325            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
326            * @return the first matching organization
327            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
328            * @throws SystemException if a system exception occurred
329            */
330            public com.liferay.portal.model.Organization findByLocations_First(
331                    long companyId,
332                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
333                    throws com.liferay.portal.NoSuchOrganizationException,
334                            com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * Returns the last organization in the ordered set where companyId = &#63;.
338            *
339            * <p>
340            * 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.
341            * </p>
342            *
343            * @param companyId the company ID
344            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
345            * @return the last matching organization
346            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
347            * @throws SystemException if a system exception occurred
348            */
349            public com.liferay.portal.model.Organization findByLocations_Last(
350                    long companyId,
351                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
352                    throws com.liferay.portal.NoSuchOrganizationException,
353                            com.liferay.portal.kernel.exception.SystemException;
354    
355            /**
356            * Returns the organizations before and after the current organization in the ordered set where companyId = &#63;.
357            *
358            * <p>
359            * 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.
360            * </p>
361            *
362            * @param organizationId the primary key of the current organization
363            * @param companyId the company ID
364            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
365            * @return the previous, current, and next organization
366            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
367            * @throws SystemException if a system exception occurred
368            */
369            public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
370                    long organizationId, long companyId,
371                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
372                    throws com.liferay.portal.NoSuchOrganizationException,
373                            com.liferay.portal.kernel.exception.SystemException;
374    
375            /**
376            * Returns all the organizations that the user has permission to view where companyId = &#63;.
377            *
378            * @param companyId the company ID
379            * @return the matching organizations that the user has permission to view
380            * @throws SystemException if a system exception occurred
381            */
382            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
383                    long companyId)
384                    throws com.liferay.portal.kernel.exception.SystemException;
385    
386            /**
387            * Returns a range of all the organizations that the user has permission to view where companyId = &#63;.
388            *
389            * <p>
390            * 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.
391            * </p>
392            *
393            * @param companyId the company ID
394            * @param start the lower bound of the range of organizations
395            * @param end the upper bound of the range of organizations (not inclusive)
396            * @return the range of matching organizations that the user has permission to view
397            * @throws SystemException if a system exception occurred
398            */
399            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
400                    long companyId, int start, int end)
401                    throws com.liferay.portal.kernel.exception.SystemException;
402    
403            /**
404            * Returns an ordered range of all the organizations that the user has permissions to view where companyId = &#63;.
405            *
406            * <p>
407            * 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.
408            * </p>
409            *
410            * @param companyId the company ID
411            * @param start the lower bound of the range of organizations
412            * @param end the upper bound of the range of organizations (not inclusive)
413            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
414            * @return the ordered range of matching organizations that the user has permission to view
415            * @throws SystemException if a system exception occurred
416            */
417            public java.util.List<com.liferay.portal.model.Organization> filterFindByLocations(
418                    long companyId, int start, int end,
419                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
420                    throws com.liferay.portal.kernel.exception.SystemException;
421    
422            /**
423            * 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;.
424            *
425            * @param organizationId the primary key of the current organization
426            * @param companyId the company ID
427            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
428            * @return the previous, current, and next organization
429            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
430            * @throws SystemException if a system exception occurred
431            */
432            public com.liferay.portal.model.Organization[] filterFindByLocations_PrevAndNext(
433                    long organizationId, long companyId,
434                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
435                    throws com.liferay.portal.NoSuchOrganizationException,
436                            com.liferay.portal.kernel.exception.SystemException;
437    
438            /**
439            * Returns all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
440            *
441            * @param companyId the company ID
442            * @param parentOrganizationId the parent organization ID
443            * @return the matching organizations
444            * @throws SystemException if a system exception occurred
445            */
446            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
447                    long companyId, long parentOrganizationId)
448                    throws com.liferay.portal.kernel.exception.SystemException;
449    
450            /**
451            * Returns a range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
452            *
453            * <p>
454            * 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.
455            * </p>
456            *
457            * @param companyId the company ID
458            * @param parentOrganizationId the parent organization ID
459            * @param start the lower bound of the range of organizations
460            * @param end the upper bound of the range of organizations (not inclusive)
461            * @return the range of matching organizations
462            * @throws SystemException if a system exception occurred
463            */
464            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
465                    long companyId, long parentOrganizationId, int start, int end)
466                    throws com.liferay.portal.kernel.exception.SystemException;
467    
468            /**
469            * Returns an ordered range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
470            *
471            * <p>
472            * 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.
473            * </p>
474            *
475            * @param companyId the company ID
476            * @param parentOrganizationId the parent organization ID
477            * @param start the lower bound of the range of organizations
478            * @param end the upper bound of the range of organizations (not inclusive)
479            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
480            * @return the ordered range of matching organizations
481            * @throws SystemException if a system exception occurred
482            */
483            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
484                    long companyId, long parentOrganizationId, int start, int end,
485                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
486                    throws com.liferay.portal.kernel.exception.SystemException;
487    
488            /**
489            * Returns the first organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
490            *
491            * <p>
492            * 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.
493            * </p>
494            *
495            * @param companyId the company ID
496            * @param parentOrganizationId the parent organization ID
497            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
498            * @return the first matching organization
499            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
500            * @throws SystemException if a system exception occurred
501            */
502            public com.liferay.portal.model.Organization findByC_P_First(
503                    long companyId, long parentOrganizationId,
504                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
505                    throws com.liferay.portal.NoSuchOrganizationException,
506                            com.liferay.portal.kernel.exception.SystemException;
507    
508            /**
509            * Returns the last organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
510            *
511            * <p>
512            * 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.
513            * </p>
514            *
515            * @param companyId the company ID
516            * @param parentOrganizationId the parent organization ID
517            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
518            * @return the last matching organization
519            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
520            * @throws SystemException if a system exception occurred
521            */
522            public com.liferay.portal.model.Organization findByC_P_Last(
523                    long companyId, long parentOrganizationId,
524                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
525                    throws com.liferay.portal.NoSuchOrganizationException,
526                            com.liferay.portal.kernel.exception.SystemException;
527    
528            /**
529            * Returns the organizations before and after the current organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
530            *
531            * <p>
532            * 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.
533            * </p>
534            *
535            * @param organizationId the primary key of the current organization
536            * @param companyId the company ID
537            * @param parentOrganizationId the parent organization ID
538            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
539            * @return the previous, current, and next organization
540            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
541            * @throws SystemException if a system exception occurred
542            */
543            public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
544                    long organizationId, long companyId, long parentOrganizationId,
545                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
546                    throws com.liferay.portal.NoSuchOrganizationException,
547                            com.liferay.portal.kernel.exception.SystemException;
548    
549            /**
550            * Returns all the organizations that the user has permission to view where companyId = &#63; and parentOrganizationId = &#63;.
551            *
552            * @param companyId the company ID
553            * @param parentOrganizationId the parent organization ID
554            * @return the matching organizations that the user has permission to view
555            * @throws SystemException if a system exception occurred
556            */
557            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
558                    long companyId, long parentOrganizationId)
559                    throws com.liferay.portal.kernel.exception.SystemException;
560    
561            /**
562            * Returns a range of all the organizations that the user has permission to view where companyId = &#63; and parentOrganizationId = &#63;.
563            *
564            * <p>
565            * 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.
566            * </p>
567            *
568            * @param companyId the company ID
569            * @param parentOrganizationId the parent organization ID
570            * @param start the lower bound of the range of organizations
571            * @param end the upper bound of the range of organizations (not inclusive)
572            * @return the range of matching organizations that the user has permission to view
573            * @throws SystemException if a system exception occurred
574            */
575            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
576                    long companyId, long parentOrganizationId, int start, int end)
577                    throws com.liferay.portal.kernel.exception.SystemException;
578    
579            /**
580            * Returns an ordered range of all the organizations that the user has permissions to view where companyId = &#63; and parentOrganizationId = &#63;.
581            *
582            * <p>
583            * 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.
584            * </p>
585            *
586            * @param companyId the company ID
587            * @param parentOrganizationId the parent organization ID
588            * @param start the lower bound of the range of organizations
589            * @param end the upper bound of the range of organizations (not inclusive)
590            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
591            * @return the ordered range of matching organizations that the user has permission to view
592            * @throws SystemException if a system exception occurred
593            */
594            public java.util.List<com.liferay.portal.model.Organization> filterFindByC_P(
595                    long companyId, long parentOrganizationId, int start, int end,
596                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
597                    throws com.liferay.portal.kernel.exception.SystemException;
598    
599            /**
600            * 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;.
601            *
602            * @param organizationId the primary key of the current organization
603            * @param companyId the company ID
604            * @param parentOrganizationId the parent organization ID
605            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
606            * @return the previous, current, and next organization
607            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
608            * @throws SystemException if a system exception occurred
609            */
610            public com.liferay.portal.model.Organization[] filterFindByC_P_PrevAndNext(
611                    long organizationId, long companyId, long parentOrganizationId,
612                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
613                    throws com.liferay.portal.NoSuchOrganizationException,
614                            com.liferay.portal.kernel.exception.SystemException;
615    
616            /**
617            * Returns the organization where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchOrganizationException} if it could not be found.
618            *
619            * @param companyId the company ID
620            * @param name the name
621            * @return the matching organization
622            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
623            * @throws SystemException if a system exception occurred
624            */
625            public com.liferay.portal.model.Organization findByC_N(long companyId,
626                    java.lang.String name)
627                    throws com.liferay.portal.NoSuchOrganizationException,
628                            com.liferay.portal.kernel.exception.SystemException;
629    
630            /**
631            * Returns the organization where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
632            *
633            * @param companyId the company ID
634            * @param name the name
635            * @return the matching organization, or <code>null</code> if a matching organization could not be found
636            * @throws SystemException if a system exception occurred
637            */
638            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
639                    java.lang.String name)
640                    throws com.liferay.portal.kernel.exception.SystemException;
641    
642            /**
643            * 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.
644            *
645            * @param companyId the company ID
646            * @param name the name
647            * @param retrieveFromCache whether to use the finder cache
648            * @return the matching organization, or <code>null</code> if a matching organization could not be found
649            * @throws SystemException if a system exception occurred
650            */
651            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
652                    java.lang.String name, boolean retrieveFromCache)
653                    throws com.liferay.portal.kernel.exception.SystemException;
654    
655            /**
656            * Returns all the organizations.
657            *
658            * @return the organizations
659            * @throws SystemException if a system exception occurred
660            */
661            public java.util.List<com.liferay.portal.model.Organization> findAll()
662                    throws com.liferay.portal.kernel.exception.SystemException;
663    
664            /**
665            * Returns a range of all the organizations.
666            *
667            * <p>
668            * 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.
669            * </p>
670            *
671            * @param start the lower bound of the range of organizations
672            * @param end the upper bound of the range of organizations (not inclusive)
673            * @return the range of organizations
674            * @throws SystemException if a system exception occurred
675            */
676            public java.util.List<com.liferay.portal.model.Organization> findAll(
677                    int start, int end)
678                    throws com.liferay.portal.kernel.exception.SystemException;
679    
680            /**
681            * Returns an ordered range of all the organizations.
682            *
683            * <p>
684            * 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.
685            * </p>
686            *
687            * @param start the lower bound of the range of organizations
688            * @param end the upper bound of the range of organizations (not inclusive)
689            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
690            * @return the ordered range of organizations
691            * @throws SystemException if a system exception occurred
692            */
693            public java.util.List<com.liferay.portal.model.Organization> findAll(
694                    int start, int end,
695                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
696                    throws com.liferay.portal.kernel.exception.SystemException;
697    
698            /**
699            * Removes all the organizations where companyId = &#63; from the database.
700            *
701            * @param companyId the company ID
702            * @throws SystemException if a system exception occurred
703            */
704            public void removeByCompanyId(long companyId)
705                    throws com.liferay.portal.kernel.exception.SystemException;
706    
707            /**
708            * Removes all the organizations where companyId = &#63; from the database.
709            *
710            * @param companyId the company ID
711            * @throws SystemException if a system exception occurred
712            */
713            public void removeByLocations(long companyId)
714                    throws com.liferay.portal.kernel.exception.SystemException;
715    
716            /**
717            * Removes all the organizations where companyId = &#63; and parentOrganizationId = &#63; from the database.
718            *
719            * @param companyId the company ID
720            * @param parentOrganizationId the parent organization ID
721            * @throws SystemException if a system exception occurred
722            */
723            public void removeByC_P(long companyId, long parentOrganizationId)
724                    throws com.liferay.portal.kernel.exception.SystemException;
725    
726            /**
727            * Removes the organization where companyId = &#63; and name = &#63; from the database.
728            *
729            * @param companyId the company ID
730            * @param name the name
731            * @throws SystemException if a system exception occurred
732            */
733            public void removeByC_N(long companyId, java.lang.String name)
734                    throws com.liferay.portal.NoSuchOrganizationException,
735                            com.liferay.portal.kernel.exception.SystemException;
736    
737            /**
738            * Removes all the organizations from the database.
739            *
740            * @throws SystemException if a system exception occurred
741            */
742            public void removeAll()
743                    throws com.liferay.portal.kernel.exception.SystemException;
744    
745            /**
746            * Returns the number of organizations where companyId = &#63;.
747            *
748            * @param companyId the company ID
749            * @return the number of matching organizations
750            * @throws SystemException if a system exception occurred
751            */
752            public int countByCompanyId(long companyId)
753                    throws com.liferay.portal.kernel.exception.SystemException;
754    
755            /**
756            * Returns the number of organizations that the user has permission to view where companyId = &#63;.
757            *
758            * @param companyId the company ID
759            * @return the number of matching organizations that the user has permission to view
760            * @throws SystemException if a system exception occurred
761            */
762            public int filterCountByCompanyId(long companyId)
763                    throws com.liferay.portal.kernel.exception.SystemException;
764    
765            /**
766            * Returns the number of organizations where companyId = &#63;.
767            *
768            * @param companyId the company ID
769            * @return the number of matching organizations
770            * @throws SystemException if a system exception occurred
771            */
772            public int countByLocations(long companyId)
773                    throws com.liferay.portal.kernel.exception.SystemException;
774    
775            /**
776            * Returns the number of organizations that the user has permission to view where companyId = &#63;.
777            *
778            * @param companyId the company ID
779            * @return the number of matching organizations that the user has permission to view
780            * @throws SystemException if a system exception occurred
781            */
782            public int filterCountByLocations(long companyId)
783                    throws com.liferay.portal.kernel.exception.SystemException;
784    
785            /**
786            * Returns the number of organizations where companyId = &#63; and parentOrganizationId = &#63;.
787            *
788            * @param companyId the company ID
789            * @param parentOrganizationId the parent organization ID
790            * @return the number of matching organizations
791            * @throws SystemException if a system exception occurred
792            */
793            public int countByC_P(long companyId, long parentOrganizationId)
794                    throws com.liferay.portal.kernel.exception.SystemException;
795    
796            /**
797            * Returns the number of organizations that the user has permission to view where companyId = &#63; and parentOrganizationId = &#63;.
798            *
799            * @param companyId the company ID
800            * @param parentOrganizationId the parent organization ID
801            * @return the number of matching organizations that the user has permission to view
802            * @throws SystemException if a system exception occurred
803            */
804            public int filterCountByC_P(long companyId, long parentOrganizationId)
805                    throws com.liferay.portal.kernel.exception.SystemException;
806    
807            /**
808            * Returns the number of organizations where companyId = &#63; and name = &#63;.
809            *
810            * @param companyId the company ID
811            * @param name the name
812            * @return the number of matching organizations
813            * @throws SystemException if a system exception occurred
814            */
815            public int countByC_N(long companyId, java.lang.String name)
816                    throws com.liferay.portal.kernel.exception.SystemException;
817    
818            /**
819            * Returns the number of organizations.
820            *
821            * @return the number of organizations
822            * @throws SystemException if a system exception occurred
823            */
824            public int countAll()
825                    throws com.liferay.portal.kernel.exception.SystemException;
826    
827            /**
828            * Returns all the groups associated with the organization.
829            *
830            * @param pk the primary key of the organization
831            * @return the groups associated with the organization
832            * @throws SystemException if a system exception occurred
833            */
834            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
835                    throws com.liferay.portal.kernel.exception.SystemException;
836    
837            /**
838            * Returns a range of all the groups associated with the organization.
839            *
840            * <p>
841            * 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.
842            * </p>
843            *
844            * @param pk the primary key of the organization
845            * @param start the lower bound of the range of organizations
846            * @param end the upper bound of the range of organizations (not inclusive)
847            * @return the range of groups associated with the organization
848            * @throws SystemException if a system exception occurred
849            */
850            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
851                    int start, int end)
852                    throws com.liferay.portal.kernel.exception.SystemException;
853    
854            /**
855            * Returns an ordered range of all the groups associated with the organization.
856            *
857            * <p>
858            * 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.
859            * </p>
860            *
861            * @param pk the primary key of the organization
862            * @param start the lower bound of the range of organizations
863            * @param end the upper bound of the range of organizations (not inclusive)
864            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
865            * @return the ordered range of groups associated with the organization
866            * @throws SystemException if a system exception occurred
867            */
868            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
869                    int start, int end,
870                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
871                    throws com.liferay.portal.kernel.exception.SystemException;
872    
873            /**
874            * Returns the number of groups associated with the organization.
875            *
876            * @param pk the primary key of the organization
877            * @return the number of groups associated with the organization
878            * @throws SystemException if a system exception occurred
879            */
880            public int getGroupsSize(long pk)
881                    throws com.liferay.portal.kernel.exception.SystemException;
882    
883            /**
884            * Returns <code>true</code> if the group is associated with the organization.
885            *
886            * @param pk the primary key of the organization
887            * @param groupPK the primary key of the group
888            * @return <code>true</code> if the group is associated with the organization; <code>false</code> otherwise
889            * @throws SystemException if a system exception occurred
890            */
891            public boolean containsGroup(long pk, long groupPK)
892                    throws com.liferay.portal.kernel.exception.SystemException;
893    
894            /**
895            * Returns <code>true</code> if the organization has any groups associated with it.
896            *
897            * @param pk the primary key of the organization to check for associations with groups
898            * @return <code>true</code> if the organization has any groups associated with it; <code>false</code> otherwise
899            * @throws SystemException if a system exception occurred
900            */
901            public boolean containsGroups(long pk)
902                    throws com.liferay.portal.kernel.exception.SystemException;
903    
904            /**
905            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
906            *
907            * @param pk the primary key of the organization
908            * @param groupPK the primary key of the group
909            * @throws SystemException if a system exception occurred
910            */
911            public void addGroup(long pk, long groupPK)
912                    throws com.liferay.portal.kernel.exception.SystemException;
913    
914            /**
915            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
916            *
917            * @param pk the primary key of the organization
918            * @param group the group
919            * @throws SystemException if a system exception occurred
920            */
921            public void addGroup(long pk, com.liferay.portal.model.Group group)
922                    throws com.liferay.portal.kernel.exception.SystemException;
923    
924            /**
925            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
926            *
927            * @param pk the primary key of the organization
928            * @param groupPKs the primary keys of the groups
929            * @throws SystemException if a system exception occurred
930            */
931            public void addGroups(long pk, long[] groupPKs)
932                    throws com.liferay.portal.kernel.exception.SystemException;
933    
934            /**
935            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
936            *
937            * @param pk the primary key of the organization
938            * @param groups the groups
939            * @throws SystemException if a system exception occurred
940            */
941            public void addGroups(long pk,
942                    java.util.List<com.liferay.portal.model.Group> groups)
943                    throws com.liferay.portal.kernel.exception.SystemException;
944    
945            /**
946            * Clears all associations between the organization and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
947            *
948            * @param pk the primary key of the organization to clear the associated groups from
949            * @throws SystemException if a system exception occurred
950            */
951            public void clearGroups(long pk)
952                    throws com.liferay.portal.kernel.exception.SystemException;
953    
954            /**
955            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
956            *
957            * @param pk the primary key of the organization
958            * @param groupPK the primary key of the group
959            * @throws SystemException if a system exception occurred
960            */
961            public void removeGroup(long pk, long groupPK)
962                    throws com.liferay.portal.kernel.exception.SystemException;
963    
964            /**
965            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
966            *
967            * @param pk the primary key of the organization
968            * @param group the group
969            * @throws SystemException if a system exception occurred
970            */
971            public void removeGroup(long pk, com.liferay.portal.model.Group group)
972                    throws com.liferay.portal.kernel.exception.SystemException;
973    
974            /**
975            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
976            *
977            * @param pk the primary key of the organization
978            * @param groupPKs the primary keys of the groups
979            * @throws SystemException if a system exception occurred
980            */
981            public void removeGroups(long pk, long[] groupPKs)
982                    throws com.liferay.portal.kernel.exception.SystemException;
983    
984            /**
985            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
986            *
987            * @param pk the primary key of the organization
988            * @param groups the groups
989            * @throws SystemException if a system exception occurred
990            */
991            public void removeGroups(long pk,
992                    java.util.List<com.liferay.portal.model.Group> groups)
993                    throws com.liferay.portal.kernel.exception.SystemException;
994    
995            /**
996            * 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.
997            *
998            * @param pk the primary key of the organization
999            * @param groupPKs the primary keys of the groups to be associated with the organization
1000            * @throws SystemException if a system exception occurred
1001            */
1002            public void setGroups(long pk, long[] groupPKs)
1003                    throws com.liferay.portal.kernel.exception.SystemException;
1004    
1005            /**
1006            * 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.
1007            *
1008            * @param pk the primary key of the organization
1009            * @param groups the groups to be associated with the organization
1010            * @throws SystemException if a system exception occurred
1011            */
1012            public void setGroups(long pk,
1013                    java.util.List<com.liferay.portal.model.Group> groups)
1014                    throws com.liferay.portal.kernel.exception.SystemException;
1015    
1016            /**
1017            * Returns all the users associated with the organization.
1018            *
1019            * @param pk the primary key of the organization
1020            * @return the users associated with the organization
1021            * @throws SystemException if a system exception occurred
1022            */
1023            public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
1024                    throws com.liferay.portal.kernel.exception.SystemException;
1025    
1026            /**
1027            * Returns a range of all the users associated with the organization.
1028            *
1029            * <p>
1030            * 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.
1031            * </p>
1032            *
1033            * @param pk the primary key of the organization
1034            * @param start the lower bound of the range of organizations
1035            * @param end the upper bound of the range of organizations (not inclusive)
1036            * @return the range of users associated with the organization
1037            * @throws SystemException if a system exception occurred
1038            */
1039            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
1040                    int start, int end)
1041                    throws com.liferay.portal.kernel.exception.SystemException;
1042    
1043            /**
1044            * Returns an ordered range of all the users associated with the organization.
1045            *
1046            * <p>
1047            * 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.
1048            * </p>
1049            *
1050            * @param pk the primary key of the organization
1051            * @param start the lower bound of the range of organizations
1052            * @param end the upper bound of the range of organizations (not inclusive)
1053            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1054            * @return the ordered range of users associated with the organization
1055            * @throws SystemException if a system exception occurred
1056            */
1057            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
1058                    int start, int end,
1059                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1060                    throws com.liferay.portal.kernel.exception.SystemException;
1061    
1062            /**
1063            * Returns the number of users associated with the organization.
1064            *
1065            * @param pk the primary key of the organization
1066            * @return the number of users associated with the organization
1067            * @throws SystemException if a system exception occurred
1068            */
1069            public int getUsersSize(long pk)
1070                    throws com.liferay.portal.kernel.exception.SystemException;
1071    
1072            /**
1073            * Returns <code>true</code> if the user is associated with the organization.
1074            *
1075            * @param pk the primary key of the organization
1076            * @param userPK the primary key of the user
1077            * @return <code>true</code> if the user is associated with the organization; <code>false</code> otherwise
1078            * @throws SystemException if a system exception occurred
1079            */
1080            public boolean containsUser(long pk, long userPK)
1081                    throws com.liferay.portal.kernel.exception.SystemException;
1082    
1083            /**
1084            * Returns <code>true</code> if the organization has any users associated with it.
1085            *
1086            * @param pk the primary key of the organization to check for associations with users
1087            * @return <code>true</code> if the organization has any users associated with it; <code>false</code> otherwise
1088            * @throws SystemException if a system exception occurred
1089            */
1090            public boolean containsUsers(long pk)
1091                    throws com.liferay.portal.kernel.exception.SystemException;
1092    
1093            /**
1094            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1095            *
1096            * @param pk the primary key of the organization
1097            * @param userPK the primary key of the user
1098            * @throws SystemException if a system exception occurred
1099            */
1100            public void addUser(long pk, long userPK)
1101                    throws com.liferay.portal.kernel.exception.SystemException;
1102    
1103            /**
1104            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1105            *
1106            * @param pk the primary key of the organization
1107            * @param user the user
1108            * @throws SystemException if a system exception occurred
1109            */
1110            public void addUser(long pk, com.liferay.portal.model.User user)
1111                    throws com.liferay.portal.kernel.exception.SystemException;
1112    
1113            /**
1114            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1115            *
1116            * @param pk the primary key of the organization
1117            * @param userPKs the primary keys of the users
1118            * @throws SystemException if a system exception occurred
1119            */
1120            public void addUsers(long pk, long[] userPKs)
1121                    throws com.liferay.portal.kernel.exception.SystemException;
1122    
1123            /**
1124            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1125            *
1126            * @param pk the primary key of the organization
1127            * @param users the users
1128            * @throws SystemException if a system exception occurred
1129            */
1130            public void addUsers(long pk,
1131                    java.util.List<com.liferay.portal.model.User> users)
1132                    throws com.liferay.portal.kernel.exception.SystemException;
1133    
1134            /**
1135            * Clears all associations between the organization and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1136            *
1137            * @param pk the primary key of the organization to clear the associated users from
1138            * @throws SystemException if a system exception occurred
1139            */
1140            public void clearUsers(long pk)
1141                    throws com.liferay.portal.kernel.exception.SystemException;
1142    
1143            /**
1144            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1145            *
1146            * @param pk the primary key of the organization
1147            * @param userPK the primary key of the user
1148            * @throws SystemException if a system exception occurred
1149            */
1150            public void removeUser(long pk, long userPK)
1151                    throws com.liferay.portal.kernel.exception.SystemException;
1152    
1153            /**
1154            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1155            *
1156            * @param pk the primary key of the organization
1157            * @param user the user
1158            * @throws SystemException if a system exception occurred
1159            */
1160            public void removeUser(long pk, com.liferay.portal.model.User user)
1161                    throws com.liferay.portal.kernel.exception.SystemException;
1162    
1163            /**
1164            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1165            *
1166            * @param pk the primary key of the organization
1167            * @param userPKs the primary keys of the users
1168            * @throws SystemException if a system exception occurred
1169            */
1170            public void removeUsers(long pk, long[] userPKs)
1171                    throws com.liferay.portal.kernel.exception.SystemException;
1172    
1173            /**
1174            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
1175            *
1176            * @param pk the primary key of the organization
1177            * @param users the users
1178            * @throws SystemException if a system exception occurred
1179            */
1180            public void removeUsers(long pk,
1181                    java.util.List<com.liferay.portal.model.User> users)
1182                    throws com.liferay.portal.kernel.exception.SystemException;
1183    
1184            /**
1185            * 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.
1186            *
1187            * @param pk the primary key of the organization
1188            * @param userPKs the primary keys of the users to be associated with the organization
1189            * @throws SystemException if a system exception occurred
1190            */
1191            public void setUsers(long pk, long[] userPKs)
1192                    throws com.liferay.portal.kernel.exception.SystemException;
1193    
1194            /**
1195            * 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.
1196            *
1197            * @param pk the primary key of the organization
1198            * @param users the users to be associated with the organization
1199            * @throws SystemException if a system exception occurred
1200            */
1201            public void setUsers(long pk,
1202                    java.util.List<com.liferay.portal.model.User> users)
1203                    throws com.liferay.portal.kernel.exception.SystemException;
1204    
1205            public Organization remove(Organization organization)
1206                    throws SystemException;
1207    }