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