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.ExpandoRow;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the expando row service. This utility wraps {@link ExpandoRowPersistenceImpl} 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 ExpandoRowPersistence
040     * @see ExpandoRowPersistenceImpl
041     * @generated
042     */
043    public class ExpandoRowUtil {
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(ExpandoRow expandoRow) {
055                    getPersistence().clearCache(expandoRow);
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<ExpandoRow> 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<ExpandoRow> 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<ExpandoRow> 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 ExpandoRow remove(ExpandoRow expandoRow)
098                    throws SystemException {
099                    return getPersistence().remove(expandoRow);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
104             */
105            public static ExpandoRow update(ExpandoRow expandoRow, boolean merge)
106                    throws SystemException {
107                    return getPersistence().update(expandoRow, merge);
108            }
109    
110            /**
111             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
112             */
113            public static ExpandoRow update(ExpandoRow expandoRow, boolean merge,
114                    ServiceContext serviceContext) throws SystemException {
115                    return getPersistence().update(expandoRow, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the expando row in the entity cache if it is enabled.
120            *
121            * @param expandoRow the expando row to cache
122            */
123            public static void cacheResult(
124                    com.liferay.portlet.expando.model.ExpandoRow expandoRow) {
125                    getPersistence().cacheResult(expandoRow);
126            }
127    
128            /**
129            * Caches the expando rows in the entity cache if it is enabled.
130            *
131            * @param expandoRows the expando rows to cache
132            */
133            public static void cacheResult(
134                    java.util.List<com.liferay.portlet.expando.model.ExpandoRow> expandoRows) {
135                    getPersistence().cacheResult(expandoRows);
136            }
137    
138            /**
139            * Creates a new expando row with the primary key. Does not add the expando row to the database.
140            *
141            * @param rowId the primary key for the new expando row
142            * @return the new expando row
143            */
144            public static com.liferay.portlet.expando.model.ExpandoRow create(
145                    long rowId) {
146                    return getPersistence().create(rowId);
147            }
148    
149            /**
150            * Removes the expando row with the primary key from the database. Also notifies the appropriate model listeners.
151            *
152            * @param rowId the primary key of the expando row to remove
153            * @return the expando row that was removed
154            * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row 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.ExpandoRow remove(
158                    long rowId)
159                    throws com.liferay.portal.kernel.exception.SystemException,
160                            com.liferay.portlet.expando.NoSuchRowException {
161                    return getPersistence().remove(rowId);
162            }
163    
164            public static com.liferay.portlet.expando.model.ExpandoRow updateImpl(
165                    com.liferay.portlet.expando.model.ExpandoRow expandoRow, boolean merge)
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    return getPersistence().updateImpl(expandoRow, merge);
168            }
169    
170            /**
171            * Finds the expando row with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found.
172            *
173            * @param rowId the primary key of the expando row to find
174            * @return the expando row
175            * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public static com.liferay.portlet.expando.model.ExpandoRow findByPrimaryKey(
179                    long rowId)
180                    throws com.liferay.portal.kernel.exception.SystemException,
181                            com.liferay.portlet.expando.NoSuchRowException {
182                    return getPersistence().findByPrimaryKey(rowId);
183            }
184    
185            /**
186            * Finds the expando row with the primary key or returns <code>null</code> if it could not be found.
187            *
188            * @param rowId the primary key of the expando row to find
189            * @return the expando row, or <code>null</code> if a expando row with the primary key could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.expando.model.ExpandoRow fetchByPrimaryKey(
193                    long rowId) throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(rowId);
195            }
196    
197            /**
198            * Finds all the expando rows where tableId = &#63;.
199            *
200            * @param tableId the table id to search with
201            * @return the matching expando rows
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
205                    long tableId)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByTableId(tableId);
208            }
209    
210            /**
211            * Finds a range of all the expando rows where tableId = &#63;.
212            *
213            * <p>
214            * 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.
215            * </p>
216            *
217            * @param tableId the table id to search with
218            * @param start the lower bound of the range of expando rows to return
219            * @param end the upper bound of the range of expando rows to return (not inclusive)
220            * @return the range of matching expando rows
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
224                    long tableId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByTableId(tableId, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the expando rows where tableId = &#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 tableId the table id to search with
237            * @param start the lower bound of the range of expando rows to return
238            * @param end the upper bound of the range of expando rows to return (not inclusive)
239            * @param orderByComparator the comparator to order the results by
240            * @return the ordered range of matching expando rows
241            * @throws SystemException if a system exception occurred
242            */
243            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
244                    long tableId, int start, int end,
245                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getPersistence()
248                                       .findByTableId(tableId, start, end, orderByComparator);
249            }
250    
251            /**
252            * Finds the first expando row in the ordered set where tableId = &#63;.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param tableId the table id to search with
259            * @param orderByComparator the comparator to order the set by
260            * @return the first matching expando row
261            * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_First(
265                    long tableId,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.kernel.exception.SystemException,
268                            com.liferay.portlet.expando.NoSuchRowException {
269                    return getPersistence().findByTableId_First(tableId, orderByComparator);
270            }
271    
272            /**
273            * Finds the last expando row in the ordered set where tableId = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param tableId the table id to search with
280            * @param orderByComparator the comparator to order the set by
281            * @return the last matching expando row
282            * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_Last(
286                    long tableId,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.kernel.exception.SystemException,
289                            com.liferay.portlet.expando.NoSuchRowException {
290                    return getPersistence().findByTableId_Last(tableId, orderByComparator);
291            }
292    
293            /**
294            * Finds the expando rows before and after the current expando row in the ordered set where tableId = &#63;.
295            *
296            * <p>
297            * 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.
298            * </p>
299            *
300            * @param rowId the primary key of the current expando row
301            * @param tableId the table id to search with
302            * @param orderByComparator the comparator to order the set by
303            * @return the previous, current, and next expando row
304            * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public static com.liferay.portlet.expando.model.ExpandoRow[] findByTableId_PrevAndNext(
308                    long rowId, long tableId,
309                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
310                    throws com.liferay.portal.kernel.exception.SystemException,
311                            com.liferay.portlet.expando.NoSuchRowException {
312                    return getPersistence()
313                                       .findByTableId_PrevAndNext(rowId, tableId, orderByComparator);
314            }
315    
316            /**
317            * Finds the expando row where tableId = &#63; and classPK = &#63; or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found.
318            *
319            * @param tableId the table id to search with
320            * @param classPK the class p k to search with
321            * @return the matching expando row
322            * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found
323            * @throws SystemException if a system exception occurred
324            */
325            public static com.liferay.portlet.expando.model.ExpandoRow findByT_C(
326                    long tableId, long classPK)
327                    throws com.liferay.portal.kernel.exception.SystemException,
328                            com.liferay.portlet.expando.NoSuchRowException {
329                    return getPersistence().findByT_C(tableId, classPK);
330            }
331    
332            /**
333            * Finds the expando row where tableId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
334            *
335            * @param tableId the table id to search with
336            * @param classPK the class p k to search with
337            * @return the matching expando row, or <code>null</code> if a matching expando row could not be found
338            * @throws SystemException if a system exception occurred
339            */
340            public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C(
341                    long tableId, long classPK)
342                    throws com.liferay.portal.kernel.exception.SystemException {
343                    return getPersistence().fetchByT_C(tableId, classPK);
344            }
345    
346            /**
347            * Finds the expando row where tableId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
348            *
349            * @param tableId the table id to search with
350            * @param classPK the class p k to search with
351            * @return the matching expando row, or <code>null</code> if a matching expando row could not be found
352            * @throws SystemException if a system exception occurred
353            */
354            public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C(
355                    long tableId, long classPK, boolean retrieveFromCache)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    return getPersistence().fetchByT_C(tableId, classPK, retrieveFromCache);
358            }
359    
360            /**
361            * Finds all the expando rows.
362            *
363            * @return the expando rows
364            * @throws SystemException if a system exception occurred
365            */
366            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll()
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    return getPersistence().findAll();
369            }
370    
371            /**
372            * Finds a range of all the expando rows.
373            *
374            * <p>
375            * 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.
376            * </p>
377            *
378            * @param start the lower bound of the range of expando rows to return
379            * @param end the upper bound of the range of expando rows to return (not inclusive)
380            * @return the range of expando rows
381            * @throws SystemException if a system exception occurred
382            */
383            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
384                    int start, int end)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getPersistence().findAll(start, end);
387            }
388    
389            /**
390            * Finds an ordered range of all the expando rows.
391            *
392            * <p>
393            * 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.
394            * </p>
395            *
396            * @param start the lower bound of the range of expando rows to return
397            * @param end the upper bound of the range of expando rows to return (not inclusive)
398            * @param orderByComparator the comparator to order the results by
399            * @return the ordered range of expando rows
400            * @throws SystemException if a system exception occurred
401            */
402            public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
403                    int start, int end,
404                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getPersistence().findAll(start, end, orderByComparator);
407            }
408    
409            /**
410            * Removes all the expando rows where tableId = &#63; from the database.
411            *
412            * @param tableId the table id to search with
413            * @throws SystemException if a system exception occurred
414            */
415            public static void removeByTableId(long tableId)
416                    throws com.liferay.portal.kernel.exception.SystemException {
417                    getPersistence().removeByTableId(tableId);
418            }
419    
420            /**
421            * Removes the expando row where tableId = &#63; and classPK = &#63; from the database.
422            *
423            * @param tableId the table id to search with
424            * @param classPK the class p k to search with
425            * @throws SystemException if a system exception occurred
426            */
427            public static void removeByT_C(long tableId, long classPK)
428                    throws com.liferay.portal.kernel.exception.SystemException,
429                            com.liferay.portlet.expando.NoSuchRowException {
430                    getPersistence().removeByT_C(tableId, classPK);
431            }
432    
433            /**
434            * Removes all the expando rows from the database.
435            *
436            * @throws SystemException if a system exception occurred
437            */
438            public static void removeAll()
439                    throws com.liferay.portal.kernel.exception.SystemException {
440                    getPersistence().removeAll();
441            }
442    
443            /**
444            * Counts all the expando rows where tableId = &#63;.
445            *
446            * @param tableId the table id to search with
447            * @return the number of matching expando rows
448            * @throws SystemException if a system exception occurred
449            */
450            public static int countByTableId(long tableId)
451                    throws com.liferay.portal.kernel.exception.SystemException {
452                    return getPersistence().countByTableId(tableId);
453            }
454    
455            /**
456            * Counts all the expando rows where tableId = &#63; and classPK = &#63;.
457            *
458            * @param tableId the table id to search with
459            * @param classPK the class p k to search with
460            * @return the number of matching expando rows
461            * @throws SystemException if a system exception occurred
462            */
463            public static int countByT_C(long tableId, long classPK)
464                    throws com.liferay.portal.kernel.exception.SystemException {
465                    return getPersistence().countByT_C(tableId, classPK);
466            }
467    
468            /**
469            * Counts all the expando rows.
470            *
471            * @return the number of expando rows
472            * @throws SystemException if a system exception occurred
473            */
474            public static int countAll()
475                    throws com.liferay.portal.kernel.exception.SystemException {
476                    return getPersistence().countAll();
477            }
478    
479            public static ExpandoRowPersistence getPersistence() {
480                    if (_persistence == null) {
481                            _persistence = (ExpandoRowPersistence)PortalBeanLocatorUtil.locate(ExpandoRowPersistence.class.getName());
482                    }
483    
484                    return _persistence;
485            }
486    
487            public void setPersistence(ExpandoRowPersistence persistence) {
488                    _persistence = persistence;
489            }
490    
491            private static ExpandoRowPersistence _persistence;
492    }