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.social.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.social.model.SocialActivitySet;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the social activity set service. This utility wraps {@link SocialActivitySetPersistenceImpl} 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 SocialActivitySetPersistence
037     * @see SocialActivitySetPersistenceImpl
038     * @generated
039     */
040    public class SocialActivitySetUtil {
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(SocialActivitySet socialActivitySet) {
058                    getPersistence().clearCache(socialActivitySet);
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<SocialActivitySet> 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<SocialActivitySet> 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<SocialActivitySet> 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)
099             */
100            public static SocialActivitySet update(SocialActivitySet socialActivitySet)
101                    throws SystemException {
102                    return getPersistence().update(socialActivitySet);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static SocialActivitySet update(
109                    SocialActivitySet socialActivitySet, ServiceContext serviceContext)
110                    throws SystemException {
111                    return getPersistence().update(socialActivitySet, serviceContext);
112            }
113    
114            /**
115            * Caches the social activity set in the entity cache if it is enabled.
116            *
117            * @param socialActivitySet the social activity set
118            */
119            public static void cacheResult(
120                    com.liferay.portlet.social.model.SocialActivitySet socialActivitySet) {
121                    getPersistence().cacheResult(socialActivitySet);
122            }
123    
124            /**
125            * Caches the social activity sets in the entity cache if it is enabled.
126            *
127            * @param socialActivitySets the social activity sets
128            */
129            public static void cacheResult(
130                    java.util.List<com.liferay.portlet.social.model.SocialActivitySet> socialActivitySets) {
131                    getPersistence().cacheResult(socialActivitySets);
132            }
133    
134            /**
135            * Creates a new social activity set with the primary key. Does not add the social activity set to the database.
136            *
137            * @param activitySetId the primary key for the new social activity set
138            * @return the new social activity set
139            */
140            public static com.liferay.portlet.social.model.SocialActivitySet create(
141                    long activitySetId) {
142                    return getPersistence().create(activitySetId);
143            }
144    
145            /**
146            * Removes the social activity set with the primary key from the database. Also notifies the appropriate model listeners.
147            *
148            * @param activitySetId the primary key of the social activity set
149            * @return the social activity set that was removed
150            * @throws com.liferay.portlet.social.NoSuchActivitySetException if a social activity set with the primary key could not be found
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portlet.social.model.SocialActivitySet remove(
154                    long activitySetId)
155                    throws com.liferay.portal.kernel.exception.SystemException,
156                            com.liferay.portlet.social.NoSuchActivitySetException {
157                    return getPersistence().remove(activitySetId);
158            }
159    
160            public static com.liferay.portlet.social.model.SocialActivitySet updateImpl(
161                    com.liferay.portlet.social.model.SocialActivitySet socialActivitySet)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().updateImpl(socialActivitySet);
164            }
165    
166            /**
167            * Returns the social activity set with the primary key or throws a {@link com.liferay.portlet.social.NoSuchActivitySetException} if it could not be found.
168            *
169            * @param activitySetId the primary key of the social activity set
170            * @return the social activity set
171            * @throws com.liferay.portlet.social.NoSuchActivitySetException if a social activity set with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portlet.social.model.SocialActivitySet findByPrimaryKey(
175                    long activitySetId)
176                    throws com.liferay.portal.kernel.exception.SystemException,
177                            com.liferay.portlet.social.NoSuchActivitySetException {
178                    return getPersistence().findByPrimaryKey(activitySetId);
179            }
180    
181            /**
182            * Returns the social activity set with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param activitySetId the primary key of the social activity set
185            * @return the social activity set, or <code>null</code> if a social activity set with the primary key could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portlet.social.model.SocialActivitySet fetchByPrimaryKey(
189                    long activitySetId)
190                    throws com.liferay.portal.kernel.exception.SystemException {
191                    return getPersistence().fetchByPrimaryKey(activitySetId);
192            }
193    
194            /**
195            * Returns all the social activity sets.
196            *
197            * @return the social activity sets
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findAll()
201                    throws com.liferay.portal.kernel.exception.SystemException {
202                    return getPersistence().findAll();
203            }
204    
205            /**
206            * Returns a range of all the social activity sets.
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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivitySetModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
210            * </p>
211            *
212            * @param start the lower bound of the range of social activity sets
213            * @param end the upper bound of the range of social activity sets (not inclusive)
214            * @return the range of social activity sets
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findAll(
218                    int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().findAll(start, end);
221            }
222    
223            /**
224            * Returns an ordered range of all the social activity sets.
225            *
226            * <p>
227            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.social.model.impl.SocialActivitySetModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
228            * </p>
229            *
230            * @param start the lower bound of the range of social activity sets
231            * @param end the upper bound of the range of social activity sets (not inclusive)
232            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
233            * @return the ordered range of social activity sets
234            * @throws SystemException if a system exception occurred
235            */
236            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findAll(
237                    int start, int end,
238                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getPersistence().findAll(start, end, orderByComparator);
241            }
242    
243            /**
244            * Removes all the social activity sets from the database.
245            *
246            * @throws SystemException if a system exception occurred
247            */
248            public static void removeAll()
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    getPersistence().removeAll();
251            }
252    
253            /**
254            * Returns the number of social activity sets.
255            *
256            * @return the number of social activity sets
257            * @throws SystemException if a system exception occurred
258            */
259            public static int countAll()
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    return getPersistence().countAll();
262            }
263    
264            public static SocialActivitySetPersistence getPersistence() {
265                    if (_persistence == null) {
266                            _persistence = (SocialActivitySetPersistence)PortalBeanLocatorUtil.locate(SocialActivitySetPersistence.class.getName());
267    
268                            ReferenceRegistry.registerReference(SocialActivitySetUtil.class,
269                                    "_persistence");
270                    }
271    
272                    return _persistence;
273            }
274    
275            /**
276             * @deprecated
277             */
278            public void setPersistence(SocialActivitySetPersistence persistence) {
279            }
280    
281            private static SocialActivitySetPersistence _persistence;
282    }