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