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