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