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