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