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.portlet.expando.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.service.ServiceContext;
022    
023    import com.liferay.portlet.expando.model.ExpandoTable;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the expando table service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ExpandoTablePersistence
036     * @see ExpandoTablePersistenceImpl
037     * @generated
038     */
039    public class ExpandoTableUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(ExpandoTable expandoTable) {
051                    getPersistence().clearCache(expandoTable);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<ExpandoTable> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<ExpandoTable> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<ExpandoTable> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static ExpandoTable remove(ExpandoTable expandoTable)
094                    throws SystemException {
095                    return getPersistence().remove(expandoTable);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static ExpandoTable update(ExpandoTable expandoTable, boolean merge)
102                    throws SystemException {
103                    return getPersistence().update(expandoTable, merge);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
108             */
109            public static ExpandoTable update(ExpandoTable expandoTable, boolean merge,
110                    ServiceContext serviceContext) throws SystemException {
111                    return getPersistence().update(expandoTable, merge, serviceContext);
112            }
113    
114            /**
115            * Caches the expando table in the entity cache if it is enabled.
116            *
117            * @param expandoTable the expando table to cache
118            */
119            public static void cacheResult(
120                    com.liferay.portlet.expando.model.ExpandoTable expandoTable) {
121                    getPersistence().cacheResult(expandoTable);
122            }
123    
124            /**
125            * Caches the expando tables in the entity cache if it is enabled.
126            *
127            * @param expandoTables the expando tables to cache
128            */
129            public static void cacheResult(
130                    java.util.List<com.liferay.portlet.expando.model.ExpandoTable> expandoTables) {
131                    getPersistence().cacheResult(expandoTables);
132            }
133    
134            /**
135            * Creates a new expando table with the primary key.
136            *
137            * @param tableId the primary key for the new expando table
138            * @return the new expando table
139            */
140            public static com.liferay.portlet.expando.model.ExpandoTable create(
141                    long tableId) {
142                    return getPersistence().create(tableId);
143            }
144    
145            /**
146            * Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param tableId the primary key of the expando table to remove
149            * @return the expando table that was removed
150            * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portlet.expando.model.ExpandoTable remove(
154                    long tableId)
155                    throws com.liferay.portal.kernel.exception.SystemException,
156                            com.liferay.portlet.expando.NoSuchTableException {
157                    return getPersistence().remove(tableId);
158            }
159    
160            public static com.liferay.portlet.expando.model.ExpandoTable updateImpl(
161                    com.liferay.portlet.expando.model.ExpandoTable expandoTable,
162                    boolean merge)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getPersistence().updateImpl(expandoTable, merge);
165            }
166    
167            /**
168            * Finds the expando table with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found.
169            *
170            * @param tableId the primary key of the expando table to find
171            * @return the expando table
172            * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.expando.model.ExpandoTable findByPrimaryKey(
176                    long tableId)
177                    throws com.liferay.portal.kernel.exception.SystemException,
178                            com.liferay.portlet.expando.NoSuchTableException {
179                    return getPersistence().findByPrimaryKey(tableId);
180            }
181    
182            /**
183            * Finds the expando table with the primary key or returns <code>null</code> if it could not be found.
184            *
185            * @param tableId the primary key of the expando table to find
186            * @return the expando table, or <code>null</code> if a expando table with the primary key could not be found
187            * @throws SystemException if a system exception occurred
188            */
189            public static com.liferay.portlet.expando.model.ExpandoTable fetchByPrimaryKey(
190                    long tableId)
191                    throws com.liferay.portal.kernel.exception.SystemException {
192                    return getPersistence().fetchByPrimaryKey(tableId);
193            }
194    
195            /**
196            * Finds all the expando tables where companyId = &#63; and classNameId = &#63;.
197            *
198            * @param companyId the company id to search with
199            * @param classNameId the class name id to search with
200            * @return the matching expando tables
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C(
204                    long companyId, long classNameId)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().findByC_C(companyId, classNameId);
207            }
208    
209            /**
210            * Finds a range of all the expando tables where companyId = &#63; and classNameId = &#63;.
211            *
212            * <p>
213            * 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.
214            * </p>
215            *
216            * @param companyId the company id to search with
217            * @param classNameId the class name id to search with
218            * @param start the lower bound of the range of expando tables to return
219            * @param end the upper bound of the range of expando tables to return (not inclusive)
220            * @return the range of matching expando tables
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C(
224                    long companyId, long classNameId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByC_C(companyId, classNameId, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the expando tables where companyId = &#63; and classNameId = &#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 classNameId the class name id to search with
238            * @param start the lower bound of the range of expando tables to return
239            * @param end the upper bound of the range of expando tables to return (not inclusive)
240            * @param orderByComparator the comparator to order the results by
241            * @return the ordered range of matching expando tables
242            * @throws SystemException if a system exception occurred
243            */
244            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C(
245                    long companyId, long classNameId, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getPersistence()
249                                       .findByC_C(companyId, classNameId, start, end,
250                            orderByComparator);
251            }
252    
253            /**
254            * Finds the first expando table in the ordered set where companyId = &#63; and classNameId = &#63;.
255            *
256            * <p>
257            * 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.
258            * </p>
259            *
260            * @param companyId the company id to search with
261            * @param classNameId the class name id to search with
262            * @param orderByComparator the comparator to order the set by
263            * @return the first matching expando table
264            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_First(
268                    long companyId, long classNameId,
269                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
270                    throws com.liferay.portal.kernel.exception.SystemException,
271                            com.liferay.portlet.expando.NoSuchTableException {
272                    return getPersistence()
273                                       .findByC_C_First(companyId, classNameId, orderByComparator);
274            }
275    
276            /**
277            * Finds the last expando table in the ordered set where companyId = &#63; and classNameId = &#63;.
278            *
279            * <p>
280            * 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.
281            * </p>
282            *
283            * @param companyId the company id to search with
284            * @param classNameId the class name id to search with
285            * @param orderByComparator the comparator to order the set by
286            * @return the last matching expando table
287            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
288            * @throws SystemException if a system exception occurred
289            */
290            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_Last(
291                    long companyId, long classNameId,
292                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
293                    throws com.liferay.portal.kernel.exception.SystemException,
294                            com.liferay.portlet.expando.NoSuchTableException {
295                    return getPersistence()
296                                       .findByC_C_Last(companyId, classNameId, orderByComparator);
297            }
298    
299            /**
300            * Finds the expando tables before and after the current expando table in the ordered set where companyId = &#63; and classNameId = &#63;.
301            *
302            * <p>
303            * 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.
304            * </p>
305            *
306            * @param tableId the primary key of the current expando table
307            * @param companyId the company id to search with
308            * @param classNameId the class name id to search with
309            * @param orderByComparator the comparator to order the set by
310            * @return the previous, current, and next expando table
311            * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found
312            * @throws SystemException if a system exception occurred
313            */
314            public static com.liferay.portlet.expando.model.ExpandoTable[] findByC_C_PrevAndNext(
315                    long tableId, long companyId, long classNameId,
316                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
317                    throws com.liferay.portal.kernel.exception.SystemException,
318                            com.liferay.portlet.expando.NoSuchTableException {
319                    return getPersistence()
320                                       .findByC_C_PrevAndNext(tableId, companyId, classNameId,
321                            orderByComparator);
322            }
323    
324            /**
325            * Finds the expando table where companyId = &#63; and classNameId = &#63; and name = &#63; or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found.
326            *
327            * @param companyId the company id to search with
328            * @param classNameId the class name id to search with
329            * @param name the name to search with
330            * @return the matching expando table
331            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_N(
335                    long companyId, long classNameId, java.lang.String name)
336                    throws com.liferay.portal.kernel.exception.SystemException,
337                            com.liferay.portlet.expando.NoSuchTableException {
338                    return getPersistence().findByC_C_N(companyId, classNameId, name);
339            }
340    
341            /**
342            * Finds the expando table where companyId = &#63; and classNameId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
343            *
344            * @param companyId the company id to search with
345            * @param classNameId the class name id to search with
346            * @param name the name to search with
347            * @return the matching expando table, or <code>null</code> if a matching expando table could not be found
348            * @throws SystemException if a system exception occurred
349            */
350            public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N(
351                    long companyId, long classNameId, java.lang.String name)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getPersistence().fetchByC_C_N(companyId, classNameId, name);
354            }
355    
356            /**
357            * Finds the expando table where companyId = &#63; and classNameId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
358            *
359            * @param companyId the company id to search with
360            * @param classNameId the class name id to search with
361            * @param name the name to search with
362            * @return the matching expando table, or <code>null</code> if a matching expando table could not be found
363            * @throws SystemException if a system exception occurred
364            */
365            public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N(
366                    long companyId, long classNameId, java.lang.String name,
367                    boolean retrieveFromCache)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getPersistence()
370                                       .fetchByC_C_N(companyId, classNameId, name, retrieveFromCache);
371            }
372    
373            /**
374            * Finds all the expando tables.
375            *
376            * @return the expando tables
377            * @throws SystemException if a system exception occurred
378            */
379            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll()
380                    throws com.liferay.portal.kernel.exception.SystemException {
381                    return getPersistence().findAll();
382            }
383    
384            /**
385            * Finds a range of all the expando tables.
386            *
387            * <p>
388            * 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.
389            * </p>
390            *
391            * @param start the lower bound of the range of expando tables to return
392            * @param end the upper bound of the range of expando tables to return (not inclusive)
393            * @return the range of expando tables
394            * @throws SystemException if a system exception occurred
395            */
396            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll(
397                    int start, int end)
398                    throws com.liferay.portal.kernel.exception.SystemException {
399                    return getPersistence().findAll(start, end);
400            }
401    
402            /**
403            * Finds an ordered range of all the expando tables.
404            *
405            * <p>
406            * 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.
407            * </p>
408            *
409            * @param start the lower bound of the range of expando tables to return
410            * @param end the upper bound of the range of expando tables to return (not inclusive)
411            * @param orderByComparator the comparator to order the results by
412            * @return the ordered range of expando tables
413            * @throws SystemException if a system exception occurred
414            */
415            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll(
416                    int start, int end,
417                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getPersistence().findAll(start, end, orderByComparator);
420            }
421    
422            /**
423            * Removes all the expando tables where companyId = &#63; and classNameId = &#63; from the database.
424            *
425            * @param companyId the company id to search with
426            * @param classNameId the class name id to search with
427            * @throws SystemException if a system exception occurred
428            */
429            public static void removeByC_C(long companyId, long classNameId)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    getPersistence().removeByC_C(companyId, classNameId);
432            }
433    
434            /**
435            * Removes the expando table where companyId = &#63; and classNameId = &#63; and name = &#63; from the database.
436            *
437            * @param companyId the company id to search with
438            * @param classNameId the class name id to search with
439            * @param name the name to search with
440            * @throws SystemException if a system exception occurred
441            */
442            public static void removeByC_C_N(long companyId, long classNameId,
443                    java.lang.String name)
444                    throws com.liferay.portal.kernel.exception.SystemException,
445                            com.liferay.portlet.expando.NoSuchTableException {
446                    getPersistence().removeByC_C_N(companyId, classNameId, name);
447            }
448    
449            /**
450            * Removes all the expando tables from the database.
451            *
452            * @throws SystemException if a system exception occurred
453            */
454            public static void removeAll()
455                    throws com.liferay.portal.kernel.exception.SystemException {
456                    getPersistence().removeAll();
457            }
458    
459            /**
460            * Counts all the expando tables where companyId = &#63; and classNameId = &#63;.
461            *
462            * @param companyId the company id to search with
463            * @param classNameId the class name id to search with
464            * @return the number of matching expando tables
465            * @throws SystemException if a system exception occurred
466            */
467            public static int countByC_C(long companyId, long classNameId)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getPersistence().countByC_C(companyId, classNameId);
470            }
471    
472            /**
473            * Counts all the expando tables where companyId = &#63; and classNameId = &#63; and name = &#63;.
474            *
475            * @param companyId the company id to search with
476            * @param classNameId the class name id to search with
477            * @param name the name to search with
478            * @return the number of matching expando tables
479            * @throws SystemException if a system exception occurred
480            */
481            public static int countByC_C_N(long companyId, long classNameId,
482                    java.lang.String name)
483                    throws com.liferay.portal.kernel.exception.SystemException {
484                    return getPersistence().countByC_C_N(companyId, classNameId, name);
485            }
486    
487            /**
488            * Counts all the expando tables.
489            *
490            * @return the number of expando tables
491            * @throws SystemException if a system exception occurred
492            */
493            public static int countAll()
494                    throws com.liferay.portal.kernel.exception.SystemException {
495                    return getPersistence().countAll();
496            }
497    
498            public static ExpandoTablePersistence getPersistence() {
499                    if (_persistence == null) {
500                            _persistence = (ExpandoTablePersistence)PortalBeanLocatorUtil.locate(ExpandoTablePersistence.class.getName());
501                    }
502    
503                    return _persistence;
504            }
505    
506            public void setPersistence(ExpandoTablePersistence persistence) {
507                    _persistence = persistence;
508            }
509    
510            private static ExpandoTablePersistence _persistence;
511    }