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