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