001    /**
002     * Copyright (c) 2000-2012 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            * <p>
256            * 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.
257            * </p>
258            *
259            * @param companyId the company ID
260            * @param classNameId the class name ID
261            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
262            * @return the first matching expando table
263            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_First(
267                    long companyId, long classNameId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.kernel.exception.SystemException,
270                            com.liferay.portlet.expando.NoSuchTableException {
271                    return getPersistence()
272                                       .findByC_C_First(companyId, classNameId, orderByComparator);
273            }
274    
275            /**
276            * Returns the last expando table in the ordered set where companyId = &#63; and classNameId = &#63;.
277            *
278            * <p>
279            * 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.
280            * </p>
281            *
282            * @param companyId the company ID
283            * @param classNameId the class name ID
284            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
285            * @return the last matching expando table
286            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
287            * @throws SystemException if a system exception occurred
288            */
289            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_Last(
290                    long companyId, long classNameId,
291                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
292                    throws com.liferay.portal.kernel.exception.SystemException,
293                            com.liferay.portlet.expando.NoSuchTableException {
294                    return getPersistence()
295                                       .findByC_C_Last(companyId, classNameId, orderByComparator);
296            }
297    
298            /**
299            * Returns the expando tables before and after the current expando table in the ordered set where companyId = &#63; and classNameId = &#63;.
300            *
301            * <p>
302            * 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.
303            * </p>
304            *
305            * @param tableId the primary key of the current expando table
306            * @param companyId the company ID
307            * @param classNameId the class name ID
308            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
309            * @return the previous, current, and next expando table
310            * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portlet.expando.model.ExpandoTable[] findByC_C_PrevAndNext(
314                    long tableId, long companyId, long classNameId,
315                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
316                    throws com.liferay.portal.kernel.exception.SystemException,
317                            com.liferay.portlet.expando.NoSuchTableException {
318                    return getPersistence()
319                                       .findByC_C_PrevAndNext(tableId, companyId, classNameId,
320                            orderByComparator);
321            }
322    
323            /**
324            * 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.
325            *
326            * @param companyId the company ID
327            * @param classNameId the class name ID
328            * @param name the name
329            * @return the matching expando table
330            * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found
331            * @throws SystemException if a system exception occurred
332            */
333            public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_N(
334                    long companyId, long classNameId, java.lang.String name)
335                    throws com.liferay.portal.kernel.exception.SystemException,
336                            com.liferay.portlet.expando.NoSuchTableException {
337                    return getPersistence().findByC_C_N(companyId, classNameId, name);
338            }
339    
340            /**
341            * 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.
342            *
343            * @param companyId the company ID
344            * @param classNameId the class name ID
345            * @param name the name
346            * @return the matching expando table, or <code>null</code> if a matching expando table could not be found
347            * @throws SystemException if a system exception occurred
348            */
349            public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N(
350                    long companyId, long classNameId, java.lang.String name)
351                    throws com.liferay.portal.kernel.exception.SystemException {
352                    return getPersistence().fetchByC_C_N(companyId, classNameId, name);
353            }
354    
355            /**
356            * 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.
357            *
358            * @param companyId the company ID
359            * @param classNameId the class name ID
360            * @param name the name
361            * @param retrieveFromCache whether to use the finder cache
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            * Returns 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            * Returns 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
392            * @param end the upper bound of the range of expando tables (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            * Returns 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
410            * @param end the upper bound of the range of expando tables (not inclusive)
411            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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
426            * @param classNameId the class name ID
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
438            * @param classNameId the class name ID
439            * @param name the name
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            * Returns the number of expando tables where companyId = &#63; and classNameId = &#63;.
461            *
462            * @param companyId the company ID
463            * @param classNameId the class name ID
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            * Returns the number of expando tables where companyId = &#63; and classNameId = &#63; and name = &#63;.
474            *
475            * @param companyId the company ID
476            * @param classNameId the class name ID
477            * @param name the name
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            * Returns the number of 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                            ReferenceRegistry.registerReference(ExpandoTableUtil.class,
503                                    "_persistence");
504                    }
505    
506                    return _persistence;
507            }
508    
509            public void setPersistence(ExpandoTablePersistence persistence) {
510                    _persistence = persistence;
511    
512                    ReferenceRegistry.registerReference(ExpandoTableUtil.class,
513                            "_persistence");
514            }
515    
516            private static ExpandoTablePersistence _persistence;
517    }