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.ResourceCode;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the resource code service. This utility wraps {@link ResourceCodePersistenceImpl} 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 ResourceCodePersistence
039     * @see ResourceCodePersistenceImpl
040     * @generated
041     */
042    public class ResourceCodeUtil {
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(ResourceCode resourceCode) {
054                    getPersistence().clearCache(resourceCode);
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<ResourceCode> 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<ResourceCode> 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<ResourceCode> 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 ResourceCode remove(ResourceCode resourceCode)
097                    throws SystemException {
098                    return getPersistence().remove(resourceCode);
099            }
100    
101            /**
102             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
103             */
104            public static ResourceCode update(ResourceCode resourceCode, boolean merge)
105                    throws SystemException {
106                    return getPersistence().update(resourceCode, merge);
107            }
108    
109            /**
110             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
111             */
112            public static ResourceCode update(ResourceCode resourceCode, boolean merge,
113                    ServiceContext serviceContext) throws SystemException {
114                    return getPersistence().update(resourceCode, merge, serviceContext);
115            }
116    
117            /**
118            * Caches the resource code in the entity cache if it is enabled.
119            *
120            * @param resourceCode the resource code to cache
121            */
122            public static void cacheResult(
123                    com.liferay.portal.model.ResourceCode resourceCode) {
124                    getPersistence().cacheResult(resourceCode);
125            }
126    
127            /**
128            * Caches the resource codes in the entity cache if it is enabled.
129            *
130            * @param resourceCodes the resource codes to cache
131            */
132            public static void cacheResult(
133                    java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) {
134                    getPersistence().cacheResult(resourceCodes);
135            }
136    
137            /**
138            * Creates a new resource code with the primary key. Does not add the resource code to the database.
139            *
140            * @param codeId the primary key for the new resource code
141            * @return the new resource code
142            */
143            public static com.liferay.portal.model.ResourceCode create(long codeId) {
144                    return getPersistence().create(codeId);
145            }
146    
147            /**
148            * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param codeId the primary key of the resource code to remove
151            * @return the resource code that was removed
152            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portal.model.ResourceCode remove(long codeId)
156                    throws com.liferay.portal.NoSuchResourceCodeException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence().remove(codeId);
159            }
160    
161            public static com.liferay.portal.model.ResourceCode updateImpl(
162                    com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(resourceCode, merge);
165            }
166    
167            /**
168            * Finds the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found.
169            *
170            * @param codeId the primary key of the resource code to find
171            * @return the resource code
172            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
176                    long codeId)
177                    throws com.liferay.portal.NoSuchResourceCodeException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().findByPrimaryKey(codeId);
180            }
181    
182            /**
183            * Finds the resource code with the primary key or returns <code>null</code> if it could not be found.
184            *
185            * @param codeId the primary key of the resource code to find
186            * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found
187            * @throws SystemException if a system exception occurred
188            */
189            public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
190                    long codeId) throws com.liferay.portal.kernel.exception.SystemException {
191                    return getPersistence().fetchByPrimaryKey(codeId);
192            }
193    
194            /**
195            * Finds all the resource codes where companyId = &#63;.
196            *
197            * @param companyId the company id to search with
198            * @return the matching resource codes
199            * @throws SystemException if a system exception occurred
200            */
201            public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
202                    long companyId)
203                    throws com.liferay.portal.kernel.exception.SystemException {
204                    return getPersistence().findByCompanyId(companyId);
205            }
206    
207            /**
208            * Finds a range of all the resource codes where companyId = &#63;.
209            *
210            * <p>
211            * 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.
212            * </p>
213            *
214            * @param companyId the company id to search with
215            * @param start the lower bound of the range of resource codes to return
216            * @param end the upper bound of the range of resource codes to return (not inclusive)
217            * @return the range of matching resource codes
218            * @throws SystemException if a system exception occurred
219            */
220            public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
221                    long companyId, int start, int end)
222                    throws com.liferay.portal.kernel.exception.SystemException {
223                    return getPersistence().findByCompanyId(companyId, start, end);
224            }
225    
226            /**
227            * Finds an ordered range of all the resource codes where companyId = &#63;.
228            *
229            * <p>
230            * 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.
231            * </p>
232            *
233            * @param companyId the company id to search with
234            * @param start the lower bound of the range of resource codes to return
235            * @param end the upper bound of the range of resource codes to return (not inclusive)
236            * @param orderByComparator the comparator to order the results by
237            * @return the ordered range of matching resource codes
238            * @throws SystemException if a system exception occurred
239            */
240            public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
241                    long companyId, int start, int end,
242                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence()
245                                       .findByCompanyId(companyId, start, end, orderByComparator);
246            }
247    
248            /**
249            * Finds the first resource code in the ordered set where companyId = &#63;.
250            *
251            * <p>
252            * 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.
253            * </p>
254            *
255            * @param companyId the company id to search with
256            * @param orderByComparator the comparator to order the set by
257            * @return the first matching resource code
258            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
259            * @throws SystemException if a system exception occurred
260            */
261            public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
262                    long companyId,
263                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
264                    throws com.liferay.portal.NoSuchResourceCodeException,
265                            com.liferay.portal.kernel.exception.SystemException {
266                    return getPersistence()
267                                       .findByCompanyId_First(companyId, orderByComparator);
268            }
269    
270            /**
271            * Finds the last resource code in the ordered set where companyId = &#63;.
272            *
273            * <p>
274            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
275            * </p>
276            *
277            * @param companyId the company id to search with
278            * @param orderByComparator the comparator to order the set by
279            * @return the last matching resource code
280            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
284                    long companyId,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.NoSuchResourceCodeException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    return getPersistence()
289                                       .findByCompanyId_Last(companyId, orderByComparator);
290            }
291    
292            /**
293            * Finds the resource codes before and after the current resource code in the ordered set where companyId = &#63;.
294            *
295            * <p>
296            * 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.
297            * </p>
298            *
299            * @param codeId the primary key of the current resource code
300            * @param companyId the company id to search with
301            * @param orderByComparator the comparator to order the set by
302            * @return the previous, current, and next resource code
303            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
304            * @throws SystemException if a system exception occurred
305            */
306            public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
307                    long codeId, long companyId,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.NoSuchResourceCodeException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getPersistence()
312                                       .findByCompanyId_PrevAndNext(codeId, companyId,
313                            orderByComparator);
314            }
315    
316            /**
317            * Finds all the resource codes where name = &#63;.
318            *
319            * @param name the name to search with
320            * @return the matching resource codes
321            * @throws SystemException if a system exception occurred
322            */
323            public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
324                    java.lang.String name)
325                    throws com.liferay.portal.kernel.exception.SystemException {
326                    return getPersistence().findByName(name);
327            }
328    
329            /**
330            * Finds a range of all the resource codes where name = &#63;.
331            *
332            * <p>
333            * 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.
334            * </p>
335            *
336            * @param name the name to search with
337            * @param start the lower bound of the range of resource codes to return
338            * @param end the upper bound of the range of resource codes to return (not inclusive)
339            * @return the range of matching resource codes
340            * @throws SystemException if a system exception occurred
341            */
342            public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
343                    java.lang.String name, int start, int end)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getPersistence().findByName(name, start, end);
346            }
347    
348            /**
349            * Finds an ordered range of all the resource codes where name = &#63;.
350            *
351            * <p>
352            * 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.
353            * </p>
354            *
355            * @param name the name to search with
356            * @param start the lower bound of the range of resource codes to return
357            * @param end the upper bound of the range of resource codes to return (not inclusive)
358            * @param orderByComparator the comparator to order the results by
359            * @return the ordered range of matching resource codes
360            * @throws SystemException if a system exception occurred
361            */
362            public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
363                    java.lang.String name, int start, int end,
364                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
365                    throws com.liferay.portal.kernel.exception.SystemException {
366                    return getPersistence().findByName(name, start, end, orderByComparator);
367            }
368    
369            /**
370            * Finds the first resource code in the ordered set where name = &#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 name the name to search with
377            * @param orderByComparator the comparator to order the set by
378            * @return the first matching resource code
379            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
380            * @throws SystemException if a system exception occurred
381            */
382            public static com.liferay.portal.model.ResourceCode findByName_First(
383                    java.lang.String name,
384                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
385                    throws com.liferay.portal.NoSuchResourceCodeException,
386                            com.liferay.portal.kernel.exception.SystemException {
387                    return getPersistence().findByName_First(name, orderByComparator);
388            }
389    
390            /**
391            * Finds the last resource code in the ordered set where name = &#63;.
392            *
393            * <p>
394            * 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.
395            * </p>
396            *
397            * @param name the name to search with
398            * @param orderByComparator the comparator to order the set by
399            * @return the last matching resource code
400            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
401            * @throws SystemException if a system exception occurred
402            */
403            public static com.liferay.portal.model.ResourceCode findByName_Last(
404                    java.lang.String name,
405                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
406                    throws com.liferay.portal.NoSuchResourceCodeException,
407                            com.liferay.portal.kernel.exception.SystemException {
408                    return getPersistence().findByName_Last(name, orderByComparator);
409            }
410    
411            /**
412            * Finds the resource codes before and after the current resource code in the ordered set where name = &#63;.
413            *
414            * <p>
415            * 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.
416            * </p>
417            *
418            * @param codeId the primary key of the current resource code
419            * @param name the name to search with
420            * @param orderByComparator the comparator to order the set by
421            * @return the previous, current, and next resource code
422            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
423            * @throws SystemException if a system exception occurred
424            */
425            public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
426                    long codeId, java.lang.String name,
427                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
428                    throws com.liferay.portal.NoSuchResourceCodeException,
429                            com.liferay.portal.kernel.exception.SystemException {
430                    return getPersistence()
431                                       .findByName_PrevAndNext(codeId, name, orderByComparator);
432            }
433    
434            /**
435            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found.
436            *
437            * @param companyId the company id to search with
438            * @param name the name to search with
439            * @param scope the scope to search with
440            * @return the matching resource code
441            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
442            * @throws SystemException if a system exception occurred
443            */
444            public static com.liferay.portal.model.ResourceCode findByC_N_S(
445                    long companyId, java.lang.String name, int scope)
446                    throws com.liferay.portal.NoSuchResourceCodeException,
447                            com.liferay.portal.kernel.exception.SystemException {
448                    return getPersistence().findByC_N_S(companyId, name, scope);
449            }
450    
451            /**
452            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
453            *
454            * @param companyId the company id to search with
455            * @param name the name to search with
456            * @param scope the scope to search with
457            * @return the matching resource code, or <code>null</code> if a matching resource code could not be found
458            * @throws SystemException if a system exception occurred
459            */
460            public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
461                    long companyId, java.lang.String name, int scope)
462                    throws com.liferay.portal.kernel.exception.SystemException {
463                    return getPersistence().fetchByC_N_S(companyId, name, scope);
464            }
465    
466            /**
467            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
468            *
469            * @param companyId the company id to search with
470            * @param name the name to search with
471            * @param scope the scope to search with
472            * @return the matching resource code, or <code>null</code> if a matching resource code could not be found
473            * @throws SystemException if a system exception occurred
474            */
475            public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
476                    long companyId, java.lang.String name, int scope,
477                    boolean retrieveFromCache)
478                    throws com.liferay.portal.kernel.exception.SystemException {
479                    return getPersistence()
480                                       .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
481            }
482    
483            /**
484            * Finds all the resource codes.
485            *
486            * @return the resource codes
487            * @throws SystemException if a system exception occurred
488            */
489            public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
490                    throws com.liferay.portal.kernel.exception.SystemException {
491                    return getPersistence().findAll();
492            }
493    
494            /**
495            * Finds a range of all the resource codes.
496            *
497            * <p>
498            * 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.
499            * </p>
500            *
501            * @param start the lower bound of the range of resource codes to return
502            * @param end the upper bound of the range of resource codes to return (not inclusive)
503            * @return the range of resource codes
504            * @throws SystemException if a system exception occurred
505            */
506            public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
507                    int start, int end)
508                    throws com.liferay.portal.kernel.exception.SystemException {
509                    return getPersistence().findAll(start, end);
510            }
511    
512            /**
513            * Finds an ordered range of all the resource codes.
514            *
515            * <p>
516            * 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.
517            * </p>
518            *
519            * @param start the lower bound of the range of resource codes to return
520            * @param end the upper bound of the range of resource codes to return (not inclusive)
521            * @param orderByComparator the comparator to order the results by
522            * @return the ordered range of resource codes
523            * @throws SystemException if a system exception occurred
524            */
525            public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
526                    int start, int end,
527                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
528                    throws com.liferay.portal.kernel.exception.SystemException {
529                    return getPersistence().findAll(start, end, orderByComparator);
530            }
531    
532            /**
533            * Removes all the resource codes where companyId = &#63; from the database.
534            *
535            * @param companyId the company id to search with
536            * @throws SystemException if a system exception occurred
537            */
538            public static void removeByCompanyId(long companyId)
539                    throws com.liferay.portal.kernel.exception.SystemException {
540                    getPersistence().removeByCompanyId(companyId);
541            }
542    
543            /**
544            * Removes all the resource codes where name = &#63; from the database.
545            *
546            * @param name the name to search with
547            * @throws SystemException if a system exception occurred
548            */
549            public static void removeByName(java.lang.String name)
550                    throws com.liferay.portal.kernel.exception.SystemException {
551                    getPersistence().removeByName(name);
552            }
553    
554            /**
555            * Removes the resource code where companyId = &#63; and name = &#63; and scope = &#63; from the database.
556            *
557            * @param companyId the company id to search with
558            * @param name the name to search with
559            * @param scope the scope to search with
560            * @throws SystemException if a system exception occurred
561            */
562            public static void removeByC_N_S(long companyId, java.lang.String name,
563                    int scope)
564                    throws com.liferay.portal.NoSuchResourceCodeException,
565                            com.liferay.portal.kernel.exception.SystemException {
566                    getPersistence().removeByC_N_S(companyId, name, scope);
567            }
568    
569            /**
570            * Removes all the resource codes from the database.
571            *
572            * @throws SystemException if a system exception occurred
573            */
574            public static void removeAll()
575                    throws com.liferay.portal.kernel.exception.SystemException {
576                    getPersistence().removeAll();
577            }
578    
579            /**
580            * Counts all the resource codes where companyId = &#63;.
581            *
582            * @param companyId the company id to search with
583            * @return the number of matching resource codes
584            * @throws SystemException if a system exception occurred
585            */
586            public static int countByCompanyId(long companyId)
587                    throws com.liferay.portal.kernel.exception.SystemException {
588                    return getPersistence().countByCompanyId(companyId);
589            }
590    
591            /**
592            * Counts all the resource codes where name = &#63;.
593            *
594            * @param name the name to search with
595            * @return the number of matching resource codes
596            * @throws SystemException if a system exception occurred
597            */
598            public static int countByName(java.lang.String name)
599                    throws com.liferay.portal.kernel.exception.SystemException {
600                    return getPersistence().countByName(name);
601            }
602    
603            /**
604            * Counts all the resource codes where companyId = &#63; and name = &#63; and scope = &#63;.
605            *
606            * @param companyId the company id to search with
607            * @param name the name to search with
608            * @param scope the scope to search with
609            * @return the number of matching resource codes
610            * @throws SystemException if a system exception occurred
611            */
612            public static int countByC_N_S(long companyId, java.lang.String name,
613                    int scope) throws com.liferay.portal.kernel.exception.SystemException {
614                    return getPersistence().countByC_N_S(companyId, name, scope);
615            }
616    
617            /**
618            * Counts all the resource codes.
619            *
620            * @return the number of resource codes
621            * @throws SystemException if a system exception occurred
622            */
623            public static int countAll()
624                    throws com.liferay.portal.kernel.exception.SystemException {
625                    return getPersistence().countAll();
626            }
627    
628            public static ResourceCodePersistence getPersistence() {
629                    if (_persistence == null) {
630                            _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName());
631                    }
632    
633                    return _persistence;
634            }
635    
636            public void setPersistence(ResourceCodePersistence persistence) {
637                    _persistence = persistence;
638            }
639    
640            private static ResourceCodePersistence _persistence;
641    }