001    /**
002     * Copyright (c) 2000-2011 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.SocialEquityHistory;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the social equity history service. This utility wraps {@link SocialEquityHistoryPersistenceImpl} 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 SocialEquityHistoryPersistence
037     * @see SocialEquityHistoryPersistenceImpl
038     * @generated
039     */
040    public class SocialEquityHistoryUtil {
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(SocialEquityHistory socialEquityHistory) {
058                    getPersistence().clearCache(socialEquityHistory);
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<SocialEquityHistory> 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<SocialEquityHistory> 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<SocialEquityHistory> 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 SocialEquityHistory remove(
101                    SocialEquityHistory socialEquityHistory) throws SystemException {
102                    return getPersistence().remove(socialEquityHistory);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
107             */
108            public static SocialEquityHistory update(
109                    SocialEquityHistory socialEquityHistory, boolean merge)
110                    throws SystemException {
111                    return getPersistence().update(socialEquityHistory, merge);
112            }
113    
114            /**
115             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
116             */
117            public static SocialEquityHistory update(
118                    SocialEquityHistory socialEquityHistory, boolean merge,
119                    ServiceContext serviceContext) throws SystemException {
120                    return getPersistence()
121                                       .update(socialEquityHistory, merge, serviceContext);
122            }
123    
124            /**
125            * Caches the social equity history in the entity cache if it is enabled.
126            *
127            * @param socialEquityHistory the social equity history
128            */
129            public static void cacheResult(
130                    com.liferay.portlet.social.model.SocialEquityHistory socialEquityHistory) {
131                    getPersistence().cacheResult(socialEquityHistory);
132            }
133    
134            /**
135            * Caches the social equity histories in the entity cache if it is enabled.
136            *
137            * @param socialEquityHistories the social equity histories
138            */
139            public static void cacheResult(
140                    java.util.List<com.liferay.portlet.social.model.SocialEquityHistory> socialEquityHistories) {
141                    getPersistence().cacheResult(socialEquityHistories);
142            }
143    
144            /**
145            * Creates a new social equity history with the primary key. Does not add the social equity history to the database.
146            *
147            * @param equityHistoryId the primary key for the new social equity history
148            * @return the new social equity history
149            */
150            public static com.liferay.portlet.social.model.SocialEquityHistory create(
151                    long equityHistoryId) {
152                    return getPersistence().create(equityHistoryId);
153            }
154    
155            /**
156            * Removes the social equity history with the primary key from the database. Also notifies the appropriate model listeners.
157            *
158            * @param equityHistoryId the primary key of the social equity history
159            * @return the social equity history that was removed
160            * @throws com.liferay.portlet.social.NoSuchEquityHistoryException if a social equity history with the primary key could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public static com.liferay.portlet.social.model.SocialEquityHistory remove(
164                    long equityHistoryId)
165                    throws com.liferay.portal.kernel.exception.SystemException,
166                            com.liferay.portlet.social.NoSuchEquityHistoryException {
167                    return getPersistence().remove(equityHistoryId);
168            }
169    
170            public static com.liferay.portlet.social.model.SocialEquityHistory updateImpl(
171                    com.liferay.portlet.social.model.SocialEquityHistory socialEquityHistory,
172                    boolean merge)
173                    throws com.liferay.portal.kernel.exception.SystemException {
174                    return getPersistence().updateImpl(socialEquityHistory, merge);
175            }
176    
177            /**
178            * Returns the social equity history with the primary key or throws a {@link com.liferay.portlet.social.NoSuchEquityHistoryException} if it could not be found.
179            *
180            * @param equityHistoryId the primary key of the social equity history
181            * @return the social equity history
182            * @throws com.liferay.portlet.social.NoSuchEquityHistoryException if a social equity history with the primary key could not be found
183            * @throws SystemException if a system exception occurred
184            */
185            public static com.liferay.portlet.social.model.SocialEquityHistory findByPrimaryKey(
186                    long equityHistoryId)
187                    throws com.liferay.portal.kernel.exception.SystemException,
188                            com.liferay.portlet.social.NoSuchEquityHistoryException {
189                    return getPersistence().findByPrimaryKey(equityHistoryId);
190            }
191    
192            /**
193            * Returns the social equity history with the primary key or returns <code>null</code> if it could not be found.
194            *
195            * @param equityHistoryId the primary key of the social equity history
196            * @return the social equity history, or <code>null</code> if a social equity history with the primary key could not be found
197            * @throws SystemException if a system exception occurred
198            */
199            public static com.liferay.portlet.social.model.SocialEquityHistory fetchByPrimaryKey(
200                    long equityHistoryId)
201                    throws com.liferay.portal.kernel.exception.SystemException {
202                    return getPersistence().fetchByPrimaryKey(equityHistoryId);
203            }
204    
205            /**
206            * Returns all the social equity histories.
207            *
208            * @return the social equity histories
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.social.model.SocialEquityHistory> findAll()
212                    throws com.liferay.portal.kernel.exception.SystemException {
213                    return getPersistence().findAll();
214            }
215    
216            /**
217            * Returns a range of all the social equity histories.
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 start the lower bound of the range of social equity histories
224            * @param end the upper bound of the range of social equity histories (not inclusive)
225            * @return the range of social equity histories
226            * @throws SystemException if a system exception occurred
227            */
228            public static java.util.List<com.liferay.portlet.social.model.SocialEquityHistory> findAll(
229                    int start, int end)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence().findAll(start, end);
232            }
233    
234            /**
235            * Returns an ordered range of all the social equity histories.
236            *
237            * <p>
238            * 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.
239            * </p>
240            *
241            * @param start the lower bound of the range of social equity histories
242            * @param end the upper bound of the range of social equity histories (not inclusive)
243            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
244            * @return the ordered range of social equity histories
245            * @throws SystemException if a system exception occurred
246            */
247            public static java.util.List<com.liferay.portlet.social.model.SocialEquityHistory> findAll(
248                    int start, int end,
249                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
250                    throws com.liferay.portal.kernel.exception.SystemException {
251                    return getPersistence().findAll(start, end, orderByComparator);
252            }
253    
254            /**
255            * Removes all the social equity histories from the database.
256            *
257            * @throws SystemException if a system exception occurred
258            */
259            public static void removeAll()
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    getPersistence().removeAll();
262            }
263    
264            /**
265            * Returns the number of social equity histories.
266            *
267            * @return the number of social equity histories
268            * @throws SystemException if a system exception occurred
269            */
270            public static int countAll()
271                    throws com.liferay.portal.kernel.exception.SystemException {
272                    return getPersistence().countAll();
273            }
274    
275            public static SocialEquityHistoryPersistence getPersistence() {
276                    if (_persistence == null) {
277                            _persistence = (SocialEquityHistoryPersistence)PortalBeanLocatorUtil.locate(SocialEquityHistoryPersistence.class.getName());
278    
279                            ReferenceRegistry.registerReference(SocialEquityHistoryUtil.class,
280                                    "_persistence");
281                    }
282    
283                    return _persistence;
284            }
285    
286            public void setPersistence(SocialEquityHistoryPersistence persistence) {
287                    _persistence = persistence;
288    
289                    ReferenceRegistry.registerReference(SocialEquityHistoryUtil.class,
290                            "_persistence");
291            }
292    
293            private static SocialEquityHistoryPersistence _persistence;
294    }