001    /**
002     * Copyright (c) 2000-2010 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     * 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.
024     * </p>
025     *
026     * <p>
027     * Caching information and settings can be found in <code>portal.properties</code>
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see OrganizationPersistenceImpl
032     * @see OrganizationUtil
033     * @generated
034     */
035    public interface OrganizationPersistence extends BasePersistence<Organization> {
036            /**
037            * Caches the organization in the entity cache if it is enabled.
038            *
039            * @param organization the organization to cache
040            */
041            public void cacheResult(com.liferay.portal.model.Organization organization);
042    
043            /**
044            * Caches the organizations in the entity cache if it is enabled.
045            *
046            * @param organizations the organizations to cache
047            */
048            public void cacheResult(
049                    java.util.List<com.liferay.portal.model.Organization> organizations);
050    
051            /**
052            * Creates a new organization with the primary key. Does not add the organization to the database.
053            *
054            * @param organizationId the primary key for the new organization
055            * @return the new organization
056            */
057            public com.liferay.portal.model.Organization create(long organizationId);
058    
059            /**
060            * Removes the organization with the primary key from the database. Also notifies the appropriate model listeners.
061            *
062            * @param organizationId the primary key of the organization to remove
063            * @return the organization that was removed
064            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public com.liferay.portal.model.Organization remove(long organizationId)
068                    throws com.liferay.portal.NoSuchOrganizationException,
069                            com.liferay.portal.kernel.exception.SystemException;
070    
071            public com.liferay.portal.model.Organization updateImpl(
072                    com.liferay.portal.model.Organization organization, boolean merge)
073                    throws com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Finds the organization with the primary key or throws a {@link com.liferay.portal.NoSuchOrganizationException} if it could not be found.
077            *
078            * @param organizationId the primary key of the organization to find
079            * @return the organization
080            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portal.model.Organization findByPrimaryKey(
084                    long organizationId)
085                    throws com.liferay.portal.NoSuchOrganizationException,
086                            com.liferay.portal.kernel.exception.SystemException;
087    
088            /**
089            * Finds the organization with the primary key or returns <code>null</code> if it could not be found.
090            *
091            * @param organizationId the primary key of the organization to find
092            * @return the organization, or <code>null</code> if a organization with the primary key could not be found
093            * @throws SystemException if a system exception occurred
094            */
095            public com.liferay.portal.model.Organization fetchByPrimaryKey(
096                    long organizationId)
097                    throws com.liferay.portal.kernel.exception.SystemException;
098    
099            /**
100            * Finds all the organizations where companyId = &#63;.
101            *
102            * @param companyId the company id to search with
103            * @return the matching organizations
104            * @throws SystemException if a system exception occurred
105            */
106            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
107                    long companyId)
108                    throws com.liferay.portal.kernel.exception.SystemException;
109    
110            /**
111            * Finds a range of all the organizations where companyId = &#63;.
112            *
113            * <p>
114            * 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.
115            * </p>
116            *
117            * @param companyId the company id to search with
118            * @param start the lower bound of the range of organizations to return
119            * @param end the upper bound of the range of organizations to return (not inclusive)
120            * @return the range of matching organizations
121            * @throws SystemException if a system exception occurred
122            */
123            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
124                    long companyId, int start, int end)
125                    throws com.liferay.portal.kernel.exception.SystemException;
126    
127            /**
128            * Finds an ordered range of all the organizations where companyId = &#63;.
129            *
130            * <p>
131            * 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.
132            * </p>
133            *
134            * @param companyId the company id to search with
135            * @param start the lower bound of the range of organizations to return
136            * @param end the upper bound of the range of organizations to return (not inclusive)
137            * @param orderByComparator the comparator to order the results by
138            * @return the ordered range of matching organizations
139            * @throws SystemException if a system exception occurred
140            */
141            public java.util.List<com.liferay.portal.model.Organization> findByCompanyId(
142                    long companyId, int start, int end,
143                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
144                    throws com.liferay.portal.kernel.exception.SystemException;
145    
146            /**
147            * Finds the first organization in the ordered set where companyId = &#63;.
148            *
149            * <p>
150            * 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.
151            * </p>
152            *
153            * @param companyId the company id to search with
154            * @param orderByComparator the comparator to order the set by
155            * @return the first matching organization
156            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public com.liferay.portal.model.Organization findByCompanyId_First(
160                    long companyId,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.NoSuchOrganizationException,
163                            com.liferay.portal.kernel.exception.SystemException;
164    
165            /**
166            * Finds the last organization in the ordered set where companyId = &#63;.
167            *
168            * <p>
169            * 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.
170            * </p>
171            *
172            * @param companyId the company id to search with
173            * @param orderByComparator the comparator to order the set by
174            * @return the last matching organization
175            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public com.liferay.portal.model.Organization findByCompanyId_Last(
179                    long companyId,
180                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
181                    throws com.liferay.portal.NoSuchOrganizationException,
182                            com.liferay.portal.kernel.exception.SystemException;
183    
184            /**
185            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63;.
186            *
187            * <p>
188            * 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.
189            * </p>
190            *
191            * @param organizationId the primary key of the current organization
192            * @param companyId the company id to search with
193            * @param orderByComparator the comparator to order the set by
194            * @return the previous, current, and next organization
195            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public com.liferay.portal.model.Organization[] findByCompanyId_PrevAndNext(
199                    long organizationId, long companyId,
200                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
201                    throws com.liferay.portal.NoSuchOrganizationException,
202                            com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Finds all the organizations where companyId = &#63;.
206            *
207            * @param companyId the company id to search with
208            * @return the matching organizations
209            * @throws SystemException if a system exception occurred
210            */
211            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
212                    long companyId)
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Finds a range of all the organizations where companyId = &#63;.
217            *
218            * <p>
219            * 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.
220            * </p>
221            *
222            * @param companyId the company id to search with
223            * @param start the lower bound of the range of organizations to return
224            * @param end the upper bound of the range of organizations to return (not inclusive)
225            * @return the range of matching organizations
226            * @throws SystemException if a system exception occurred
227            */
228            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
229                    long companyId, int start, int end)
230                    throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Finds an ordered range of all the organizations where companyId = &#63;.
234            *
235            * <p>
236            * 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.
237            * </p>
238            *
239            * @param companyId the company id to search with
240            * @param start the lower bound of the range of organizations to return
241            * @param end the upper bound of the range of organizations to return (not inclusive)
242            * @param orderByComparator the comparator to order the results by
243            * @return the ordered range of matching organizations
244            * @throws SystemException if a system exception occurred
245            */
246            public java.util.List<com.liferay.portal.model.Organization> findByLocations(
247                    long companyId, int start, int end,
248                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            /**
252            * Finds the first organization in the ordered set where companyId = &#63;.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param companyId the company id to search with
259            * @param orderByComparator the comparator to order the set by
260            * @return the first matching organization
261            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public com.liferay.portal.model.Organization findByLocations_First(
265                    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            * Finds the last organization in the ordered set where companyId = &#63;.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param companyId the company id to search with
278            * @param orderByComparator the comparator to order the set by
279            * @return the last matching organization
280            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public com.liferay.portal.model.Organization findByLocations_Last(
284                    long companyId,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.NoSuchOrganizationException,
287                            com.liferay.portal.kernel.exception.SystemException;
288    
289            /**
290            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63;.
291            *
292            * <p>
293            * 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.
294            * </p>
295            *
296            * @param organizationId the primary key of the current organization
297            * @param companyId the company id to search with
298            * @param orderByComparator the comparator to order the set by
299            * @return the previous, current, and next organization
300            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public com.liferay.portal.model.Organization[] findByLocations_PrevAndNext(
304                    long organizationId, long companyId,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.NoSuchOrganizationException,
307                            com.liferay.portal.kernel.exception.SystemException;
308    
309            /**
310            * Finds all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
311            *
312            * @param companyId the company id to search with
313            * @param parentOrganizationId the parent organization id to search with
314            * @return the matching organizations
315            * @throws SystemException if a system exception occurred
316            */
317            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
318                    long companyId, long parentOrganizationId)
319                    throws com.liferay.portal.kernel.exception.SystemException;
320    
321            /**
322            * Finds a range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
323            *
324            * <p>
325            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
326            * </p>
327            *
328            * @param companyId the company id to search with
329            * @param parentOrganizationId the parent organization id to search with
330            * @param start the lower bound of the range of organizations to return
331            * @param end the upper bound of the range of organizations to return (not inclusive)
332            * @return the range of matching organizations
333            * @throws SystemException if a system exception occurred
334            */
335            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
336                    long companyId, long parentOrganizationId, int start, int end)
337                    throws com.liferay.portal.kernel.exception.SystemException;
338    
339            /**
340            * Finds an ordered range of all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
341            *
342            * <p>
343            * 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.
344            * </p>
345            *
346            * @param companyId the company id to search with
347            * @param parentOrganizationId the parent organization id to search with
348            * @param start the lower bound of the range of organizations to return
349            * @param end the upper bound of the range of organizations to return (not inclusive)
350            * @param orderByComparator the comparator to order the results by
351            * @return the ordered range of matching organizations
352            * @throws SystemException if a system exception occurred
353            */
354            public java.util.List<com.liferay.portal.model.Organization> findByC_P(
355                    long companyId, long parentOrganizationId, int start, int end,
356                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
357                    throws com.liferay.portal.kernel.exception.SystemException;
358    
359            /**
360            * Finds the first organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
361            *
362            * <p>
363            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
364            * </p>
365            *
366            * @param companyId the company id to search with
367            * @param parentOrganizationId the parent organization id to search with
368            * @param orderByComparator the comparator to order the set by
369            * @return the first matching organization
370            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
371            * @throws SystemException if a system exception occurred
372            */
373            public com.liferay.portal.model.Organization findByC_P_First(
374                    long companyId, long parentOrganizationId,
375                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
376                    throws com.liferay.portal.NoSuchOrganizationException,
377                            com.liferay.portal.kernel.exception.SystemException;
378    
379            /**
380            * Finds the last organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
381            *
382            * <p>
383            * 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.
384            * </p>
385            *
386            * @param companyId the company id to search with
387            * @param parentOrganizationId the parent organization id to search with
388            * @param orderByComparator the comparator to order the set by
389            * @return the last matching organization
390            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
391            * @throws SystemException if a system exception occurred
392            */
393            public com.liferay.portal.model.Organization findByC_P_Last(
394                    long companyId, long parentOrganizationId,
395                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
396                    throws com.liferay.portal.NoSuchOrganizationException,
397                            com.liferay.portal.kernel.exception.SystemException;
398    
399            /**
400            * Finds the organizations before and after the current organization in the ordered set where companyId = &#63; and parentOrganizationId = &#63;.
401            *
402            * <p>
403            * 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.
404            * </p>
405            *
406            * @param organizationId the primary key of the current organization
407            * @param companyId the company id to search with
408            * @param parentOrganizationId the parent organization id to search with
409            * @param orderByComparator the comparator to order the set by
410            * @return the previous, current, and next organization
411            * @throws com.liferay.portal.NoSuchOrganizationException if a organization with the primary key could not be found
412            * @throws SystemException if a system exception occurred
413            */
414            public com.liferay.portal.model.Organization[] findByC_P_PrevAndNext(
415                    long organizationId, long companyId, long parentOrganizationId,
416                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
417                    throws com.liferay.portal.NoSuchOrganizationException,
418                            com.liferay.portal.kernel.exception.SystemException;
419    
420            /**
421            * Finds the organization where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchOrganizationException} if it could not be found.
422            *
423            * @param companyId the company id to search with
424            * @param name the name to search with
425            * @return the matching organization
426            * @throws com.liferay.portal.NoSuchOrganizationException if a matching organization could not be found
427            * @throws SystemException if a system exception occurred
428            */
429            public com.liferay.portal.model.Organization findByC_N(long companyId,
430                    java.lang.String name)
431                    throws com.liferay.portal.NoSuchOrganizationException,
432                            com.liferay.portal.kernel.exception.SystemException;
433    
434            /**
435            * Finds the organization where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
436            *
437            * @param companyId the company id to search with
438            * @param name the name to search with
439            * @return the matching organization, or <code>null</code> if a matching organization could not be found
440            * @throws SystemException if a system exception occurred
441            */
442            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
443                    java.lang.String name)
444                    throws com.liferay.portal.kernel.exception.SystemException;
445    
446            /**
447            * Finds the organization where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
448            *
449            * @param companyId the company id to search with
450            * @param name the name to search with
451            * @return the matching organization, or <code>null</code> if a matching organization could not be found
452            * @throws SystemException if a system exception occurred
453            */
454            public com.liferay.portal.model.Organization fetchByC_N(long companyId,
455                    java.lang.String name, boolean retrieveFromCache)
456                    throws com.liferay.portal.kernel.exception.SystemException;
457    
458            /**
459            * Finds all the organizations.
460            *
461            * @return the organizations
462            * @throws SystemException if a system exception occurred
463            */
464            public java.util.List<com.liferay.portal.model.Organization> findAll()
465                    throws com.liferay.portal.kernel.exception.SystemException;
466    
467            /**
468            * Finds a range of all the organizations.
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 start the lower bound of the range of organizations to return
475            * @param end the upper bound of the range of organizations to return (not inclusive)
476            * @return the range of organizations
477            * @throws SystemException if a system exception occurred
478            */
479            public java.util.List<com.liferay.portal.model.Organization> findAll(
480                    int start, int end)
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * Finds an ordered range of all the organizations.
485            *
486            * <p>
487            * 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.
488            * </p>
489            *
490            * @param start the lower bound of the range of organizations to return
491            * @param end the upper bound of the range of organizations to return (not inclusive)
492            * @param orderByComparator the comparator to order the results by
493            * @return the ordered range of organizations
494            * @throws SystemException if a system exception occurred
495            */
496            public java.util.List<com.liferay.portal.model.Organization> findAll(
497                    int start, int end,
498                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
499                    throws com.liferay.portal.kernel.exception.SystemException;
500    
501            /**
502            * Removes all the organizations where companyId = &#63; from the database.
503            *
504            * @param companyId the company id to search with
505            * @throws SystemException if a system exception occurred
506            */
507            public void removeByCompanyId(long companyId)
508                    throws com.liferay.portal.kernel.exception.SystemException;
509    
510            /**
511            * Removes all the organizations where companyId = &#63; from the database.
512            *
513            * @param companyId the company id to search with
514            * @throws SystemException if a system exception occurred
515            */
516            public void removeByLocations(long companyId)
517                    throws com.liferay.portal.kernel.exception.SystemException;
518    
519            /**
520            * Removes all the organizations where companyId = &#63; and parentOrganizationId = &#63; from the database.
521            *
522            * @param companyId the company id to search with
523            * @param parentOrganizationId the parent organization id to search with
524            * @throws SystemException if a system exception occurred
525            */
526            public void removeByC_P(long companyId, long parentOrganizationId)
527                    throws com.liferay.portal.kernel.exception.SystemException;
528    
529            /**
530            * Removes the organization where companyId = &#63; and name = &#63; from the database.
531            *
532            * @param companyId the company id to search with
533            * @param name the name to search with
534            * @throws SystemException if a system exception occurred
535            */
536            public void removeByC_N(long companyId, java.lang.String name)
537                    throws com.liferay.portal.NoSuchOrganizationException,
538                            com.liferay.portal.kernel.exception.SystemException;
539    
540            /**
541            * Removes all the organizations from the database.
542            *
543            * @throws SystemException if a system exception occurred
544            */
545            public void removeAll()
546                    throws com.liferay.portal.kernel.exception.SystemException;
547    
548            /**
549            * Counts all the organizations where companyId = &#63;.
550            *
551            * @param companyId the company id to search with
552            * @return the number of matching organizations
553            * @throws SystemException if a system exception occurred
554            */
555            public int countByCompanyId(long companyId)
556                    throws com.liferay.portal.kernel.exception.SystemException;
557    
558            /**
559            * Counts all the organizations where companyId = &#63;.
560            *
561            * @param companyId the company id to search with
562            * @return the number of matching organizations
563            * @throws SystemException if a system exception occurred
564            */
565            public int countByLocations(long companyId)
566                    throws com.liferay.portal.kernel.exception.SystemException;
567    
568            /**
569            * Counts all the organizations where companyId = &#63; and parentOrganizationId = &#63;.
570            *
571            * @param companyId the company id to search with
572            * @param parentOrganizationId the parent organization id to search with
573            * @return the number of matching organizations
574            * @throws SystemException if a system exception occurred
575            */
576            public int countByC_P(long companyId, long parentOrganizationId)
577                    throws com.liferay.portal.kernel.exception.SystemException;
578    
579            /**
580            * Counts all the organizations where companyId = &#63; and name = &#63;.
581            *
582            * @param companyId the company id to search with
583            * @param name the name to search with
584            * @return the number of matching organizations
585            * @throws SystemException if a system exception occurred
586            */
587            public int countByC_N(long companyId, java.lang.String name)
588                    throws com.liferay.portal.kernel.exception.SystemException;
589    
590            /**
591            * Counts all the organizations.
592            *
593            * @return the number of organizations
594            * @throws SystemException if a system exception occurred
595            */
596            public int countAll()
597                    throws com.liferay.portal.kernel.exception.SystemException;
598    
599            /**
600            * Gets all the groups associated with the organization.
601            *
602            * @param pk the primary key of the organization to get the associated groups for
603            * @return the groups associated with the organization
604            * @throws SystemException if a system exception occurred
605            */
606            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
607                    throws com.liferay.portal.kernel.exception.SystemException;
608    
609            /**
610            * Gets a range of all the groups associated with the organization.
611            *
612            * <p>
613            * 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.
614            * </p>
615            *
616            * @param pk the primary key of the organization to get the associated groups for
617            * @param start the lower bound of the range of organizations to return
618            * @param end the upper bound of the range of organizations to return (not inclusive)
619            * @return the range of groups associated with the organization
620            * @throws SystemException if a system exception occurred
621            */
622            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
623                    int start, int end)
624                    throws com.liferay.portal.kernel.exception.SystemException;
625    
626            /**
627            * Gets an ordered range of all the groups associated with the organization.
628            *
629            * <p>
630            * 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.
631            * </p>
632            *
633            * @param pk the primary key of the organization to get the associated groups for
634            * @param start the lower bound of the range of organizations to return
635            * @param end the upper bound of the range of organizations to return (not inclusive)
636            * @param orderByComparator the comparator to order the results by
637            * @return the ordered range of groups associated with the organization
638            * @throws SystemException if a system exception occurred
639            */
640            public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
641                    int start, int end,
642                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
643                    throws com.liferay.portal.kernel.exception.SystemException;
644    
645            /**
646            * Gets the number of groups associated with the organization.
647            *
648            * @param pk the primary key of the organization to get the number of associated groups for
649            * @return the number of groups associated with the organization
650            * @throws SystemException if a system exception occurred
651            */
652            public int getGroupsSize(long pk)
653                    throws com.liferay.portal.kernel.exception.SystemException;
654    
655            /**
656            * Determines whether the group is associated with the organization.
657            *
658            * @param pk the primary key of the organization
659            * @param groupPK the primary key of the group
660            * @return whether the group is associated with the organization
661            * @throws SystemException if a system exception occurred
662            */
663            public boolean containsGroup(long pk, long groupPK)
664                    throws com.liferay.portal.kernel.exception.SystemException;
665    
666            /**
667            * Determines whether the organization has any groups associated with it.
668            *
669            * @param pk the primary key of the organization to check for associations with groups
670            * @return whether the organization has any groups associated with it
671            * @throws SystemException if a system exception occurred
672            */
673            public boolean containsGroups(long pk)
674                    throws com.liferay.portal.kernel.exception.SystemException;
675    
676            /**
677            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
678            *
679            * @param pk the primary key of the organization
680            * @param groupPK the primary key of the group
681            * @throws SystemException if a system exception occurred
682            */
683            public void addGroup(long pk, long groupPK)
684                    throws com.liferay.portal.kernel.exception.SystemException;
685    
686            /**
687            * Adds an association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
688            *
689            * @param pk the primary key of the organization
690            * @param group the group
691            * @throws SystemException if a system exception occurred
692            */
693            public void addGroup(long pk, com.liferay.portal.model.Group group)
694                    throws com.liferay.portal.kernel.exception.SystemException;
695    
696            /**
697            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
698            *
699            * @param pk the primary key of the organization
700            * @param groupPKs the primary keys of the groups
701            * @throws SystemException if a system exception occurred
702            */
703            public void addGroups(long pk, long[] groupPKs)
704                    throws com.liferay.portal.kernel.exception.SystemException;
705    
706            /**
707            * Adds an association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
708            *
709            * @param pk the primary key of the organization
710            * @param groups the groups
711            * @throws SystemException if a system exception occurred
712            */
713            public void addGroups(long pk,
714                    java.util.List<com.liferay.portal.model.Group> groups)
715                    throws com.liferay.portal.kernel.exception.SystemException;
716    
717            /**
718            * Clears all associations between the organization and its groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
719            *
720            * @param pk the primary key of the organization to clear the associated groups from
721            * @throws SystemException if a system exception occurred
722            */
723            public void clearGroups(long pk)
724                    throws com.liferay.portal.kernel.exception.SystemException;
725    
726            /**
727            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
728            *
729            * @param pk the primary key of the organization
730            * @param groupPK the primary key of the group
731            * @throws SystemException if a system exception occurred
732            */
733            public void removeGroup(long pk, long groupPK)
734                    throws com.liferay.portal.kernel.exception.SystemException;
735    
736            /**
737            * Removes the association between the organization and the group. Also notifies the appropriate model listeners and clears the mapping table finder cache.
738            *
739            * @param pk the primary key of the organization
740            * @param group the group
741            * @throws SystemException if a system exception occurred
742            */
743            public void removeGroup(long pk, com.liferay.portal.model.Group group)
744                    throws com.liferay.portal.kernel.exception.SystemException;
745    
746            /**
747            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
748            *
749            * @param pk the primary key of the organization
750            * @param groupPKs the primary keys of the groups
751            * @throws SystemException if a system exception occurred
752            */
753            public void removeGroups(long pk, long[] groupPKs)
754                    throws com.liferay.portal.kernel.exception.SystemException;
755    
756            /**
757            * Removes the association between the organization and the groups. Also notifies the appropriate model listeners and clears the mapping table finder cache.
758            *
759            * @param pk the primary key of the organization
760            * @param groups the groups
761            * @throws SystemException if a system exception occurred
762            */
763            public void removeGroups(long pk,
764                    java.util.List<com.liferay.portal.model.Group> groups)
765                    throws com.liferay.portal.kernel.exception.SystemException;
766    
767            /**
768            * 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.
769            *
770            * @param pk the primary key of the organization to set the associations for
771            * @param groupPKs the primary keys of the groups to be associated with the organization
772            * @throws SystemException if a system exception occurred
773            */
774            public void setGroups(long pk, long[] groupPKs)
775                    throws com.liferay.portal.kernel.exception.SystemException;
776    
777            /**
778            * 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.
779            *
780            * @param pk the primary key of the organization to set the associations for
781            * @param groups the groups to be associated with the organization
782            * @throws SystemException if a system exception occurred
783            */
784            public void setGroups(long pk,
785                    java.util.List<com.liferay.portal.model.Group> groups)
786                    throws com.liferay.portal.kernel.exception.SystemException;
787    
788            /**
789            * Gets all the users associated with the organization.
790            *
791            * @param pk the primary key of the organization to get the associated users for
792            * @return the users associated with the organization
793            * @throws SystemException if a system exception occurred
794            */
795            public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
796                    throws com.liferay.portal.kernel.exception.SystemException;
797    
798            /**
799            * Gets a range of all the users associated with the organization.
800            *
801            * <p>
802            * 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.
803            * </p>
804            *
805            * @param pk the primary key of the organization to get the associated users for
806            * @param start the lower bound of the range of organizations to return
807            * @param end the upper bound of the range of organizations to return (not inclusive)
808            * @return the range of users associated with the organization
809            * @throws SystemException if a system exception occurred
810            */
811            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
812                    int start, int end)
813                    throws com.liferay.portal.kernel.exception.SystemException;
814    
815            /**
816            * Gets an ordered range of all the users associated with the organization.
817            *
818            * <p>
819            * 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.
820            * </p>
821            *
822            * @param pk the primary key of the organization to get the associated users for
823            * @param start the lower bound of the range of organizations to return
824            * @param end the upper bound of the range of organizations to return (not inclusive)
825            * @param orderByComparator the comparator to order the results by
826            * @return the ordered range of users associated with the organization
827            * @throws SystemException if a system exception occurred
828            */
829            public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
830                    int start, int end,
831                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
832                    throws com.liferay.portal.kernel.exception.SystemException;
833    
834            /**
835            * Gets the number of users associated with the organization.
836            *
837            * @param pk the primary key of the organization to get the number of associated users for
838            * @return the number of users associated with the organization
839            * @throws SystemException if a system exception occurred
840            */
841            public int getUsersSize(long pk)
842                    throws com.liferay.portal.kernel.exception.SystemException;
843    
844            /**
845            * Determines whether the user is associated with the organization.
846            *
847            * @param pk the primary key of the organization
848            * @param userPK the primary key of the user
849            * @return whether the user is associated with the organization
850            * @throws SystemException if a system exception occurred
851            */
852            public boolean containsUser(long pk, long userPK)
853                    throws com.liferay.portal.kernel.exception.SystemException;
854    
855            /**
856            * Determines whether the organization has any users associated with it.
857            *
858            * @param pk the primary key of the organization to check for associations with users
859            * @return whether the organization has any users associated with it
860            * @throws SystemException if a system exception occurred
861            */
862            public boolean containsUsers(long pk)
863                    throws com.liferay.portal.kernel.exception.SystemException;
864    
865            /**
866            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
867            *
868            * @param pk the primary key of the organization
869            * @param userPK the primary key of the user
870            * @throws SystemException if a system exception occurred
871            */
872            public void addUser(long pk, long userPK)
873                    throws com.liferay.portal.kernel.exception.SystemException;
874    
875            /**
876            * Adds an association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
877            *
878            * @param pk the primary key of the organization
879            * @param user the user
880            * @throws SystemException if a system exception occurred
881            */
882            public void addUser(long pk, com.liferay.portal.model.User user)
883                    throws com.liferay.portal.kernel.exception.SystemException;
884    
885            /**
886            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
887            *
888            * @param pk the primary key of the organization
889            * @param userPKs the primary keys of the users
890            * @throws SystemException if a system exception occurred
891            */
892            public void addUsers(long pk, long[] userPKs)
893                    throws com.liferay.portal.kernel.exception.SystemException;
894    
895            /**
896            * Adds an association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
897            *
898            * @param pk the primary key of the organization
899            * @param users the users
900            * @throws SystemException if a system exception occurred
901            */
902            public void addUsers(long pk,
903                    java.util.List<com.liferay.portal.model.User> users)
904                    throws com.liferay.portal.kernel.exception.SystemException;
905    
906            /**
907            * Clears all associations between the organization and its users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
908            *
909            * @param pk the primary key of the organization to clear the associated users from
910            * @throws SystemException if a system exception occurred
911            */
912            public void clearUsers(long pk)
913                    throws com.liferay.portal.kernel.exception.SystemException;
914    
915            /**
916            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
917            *
918            * @param pk the primary key of the organization
919            * @param userPK the primary key of the user
920            * @throws SystemException if a system exception occurred
921            */
922            public void removeUser(long pk, long userPK)
923                    throws com.liferay.portal.kernel.exception.SystemException;
924    
925            /**
926            * Removes the association between the organization and the user. Also notifies the appropriate model listeners and clears the mapping table finder cache.
927            *
928            * @param pk the primary key of the organization
929            * @param user the user
930            * @throws SystemException if a system exception occurred
931            */
932            public void removeUser(long pk, com.liferay.portal.model.User user)
933                    throws com.liferay.portal.kernel.exception.SystemException;
934    
935            /**
936            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
937            *
938            * @param pk the primary key of the organization
939            * @param userPKs the primary keys of the users
940            * @throws SystemException if a system exception occurred
941            */
942            public void removeUsers(long pk, long[] userPKs)
943                    throws com.liferay.portal.kernel.exception.SystemException;
944    
945            /**
946            * Removes the association between the organization and the users. Also notifies the appropriate model listeners and clears the mapping table finder cache.
947            *
948            * @param pk the primary key of the organization
949            * @param users the users
950            * @throws SystemException if a system exception occurred
951            */
952            public void removeUsers(long pk,
953                    java.util.List<com.liferay.portal.model.User> users)
954                    throws com.liferay.portal.kernel.exception.SystemException;
955    
956            /**
957            * 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.
958            *
959            * @param pk the primary key of the organization to set the associations for
960            * @param userPKs the primary keys of the users to be associated with the organization
961            * @throws SystemException if a system exception occurred
962            */
963            public void setUsers(long pk, long[] userPKs)
964                    throws com.liferay.portal.kernel.exception.SystemException;
965    
966            /**
967            * 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.
968            *
969            * @param pk the primary key of the organization to set the associations for
970            * @param users the users to be associated with the organization
971            * @throws SystemException if a system exception occurred
972            */
973            public void setUsers(long pk,
974                    java.util.List<com.liferay.portal.model.User> users)
975                    throws com.liferay.portal.kernel.exception.SystemException;
976    
977            /**
978            * Rebuilds the organizations tree for the scope using the modified pre-order tree traversal algorithm.
979            *
980            * <p>
981            * Only call this method if the tree has become stale through operations other than normal CRUD. Under normal circumstances the tree is automatically rebuilt whenver necessary.
982            * </p>
983            *
984            * @param companyId the id of the scope to rebuild the tree for
985            * @param force whether to force the rebuild even if the tree is not stale
986            */
987            public void rebuildTree(long companyId, boolean force)
988                    throws com.liferay.portal.kernel.exception.SystemException;
989    }