001    /**
002     * Copyright (c) 2000-present 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.trash.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for TrashVersion. This utility wraps
024     * {@link com.liferay.portlet.trash.service.impl.TrashVersionLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see TrashVersionLocalService
032     * @see com.liferay.portlet.trash.service.base.TrashVersionLocalServiceBaseImpl
033     * @see com.liferay.portlet.trash.service.impl.TrashVersionLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class TrashVersionLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashVersionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.trash.model.TrashVersion addTrashVersion(
044                    long trashEntryId, java.lang.String className, long classPK,
045                    int status,
046                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
047                    return getService()
048                                       .addTrashVersion(trashEntryId, className, classPK, status,
049                            typeSettingsProperties);
050            }
051    
052            /**
053            * Adds the trash version to the database. Also notifies the appropriate model listeners.
054            *
055            * @param trashVersion the trash version
056            * @return the trash version that was added
057            */
058            public static com.liferay.portlet.trash.model.TrashVersion addTrashVersion(
059                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
060                    return getService().addTrashVersion(trashVersion);
061            }
062    
063            /**
064            * Creates a new trash version with the primary key. Does not add the trash version to the database.
065            *
066            * @param versionId the primary key for the new trash version
067            * @return the new trash version
068            */
069            public static com.liferay.portlet.trash.model.TrashVersion createTrashVersion(
070                    long versionId) {
071                    return getService().createTrashVersion(versionId);
072            }
073    
074            /**
075            * @throws PortalException
076            */
077            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
078                    com.liferay.portal.model.PersistedModel persistedModel)
079                    throws com.liferay.portal.kernel.exception.PortalException {
080                    return getService().deletePersistedModel(persistedModel);
081            }
082    
083            public static com.liferay.portlet.trash.model.TrashVersion deleteTrashVersion(
084                    java.lang.String className, long classPK) {
085                    return getService().deleteTrashVersion(className, classPK);
086            }
087    
088            /**
089            * Deletes the trash version from the database. Also notifies the appropriate model listeners.
090            *
091            * @param trashVersion the trash version
092            * @return the trash version that was removed
093            */
094            public static com.liferay.portlet.trash.model.TrashVersion deleteTrashVersion(
095                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
096                    return getService().deleteTrashVersion(trashVersion);
097            }
098    
099            /**
100            * Deletes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
101            *
102            * @param versionId the primary key of the trash version
103            * @return the trash version that was removed
104            * @throws PortalException if a trash version with the primary key could not be found
105            */
106            public static com.liferay.portlet.trash.model.TrashVersion deleteTrashVersion(
107                    long versionId)
108                    throws com.liferay.portal.kernel.exception.PortalException {
109                    return getService().deleteTrashVersion(versionId);
110            }
111    
112            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
113                    return getService().dynamicQuery();
114            }
115    
116            /**
117            * Performs a dynamic query on the database and returns the matching rows.
118            *
119            * @param dynamicQuery the dynamic query
120            * @return the matching rows
121            */
122            public static <T> java.util.List<T> dynamicQuery(
123                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
124                    return getService().dynamicQuery(dynamicQuery);
125            }
126    
127            /**
128            * Performs a dynamic query on the database and returns a range of the matching rows.
129            *
130            * <p>
131            * 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.trash.model.impl.TrashVersionModelImpl}. 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.
132            * </p>
133            *
134            * @param dynamicQuery the dynamic query
135            * @param start the lower bound of the range of model instances
136            * @param end the upper bound of the range of model instances (not inclusive)
137            * @return the range of matching rows
138            */
139            public static <T> java.util.List<T> dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end) {
142                    return getService().dynamicQuery(dynamicQuery, start, end);
143            }
144    
145            /**
146            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
147            *
148            * <p>
149            * 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.trash.model.impl.TrashVersionModelImpl}. 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.
150            * </p>
151            *
152            * @param dynamicQuery the dynamic query
153            * @param start the lower bound of the range of model instances
154            * @param end the upper bound of the range of model instances (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching rows
157            */
158            public static <T> java.util.List<T> dynamicQuery(
159                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
160                    int end,
161                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
162                    return getService()
163                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
164            }
165    
166            /**
167            * Returns the number of rows matching the dynamic query.
168            *
169            * @param dynamicQuery the dynamic query
170            * @return the number of rows matching the dynamic query
171            */
172            public static long dynamicQueryCount(
173                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
174                    return getService().dynamicQueryCount(dynamicQuery);
175            }
176    
177            /**
178            * Returns the number of rows matching the dynamic query.
179            *
180            * @param dynamicQuery the dynamic query
181            * @param projection the projection to apply to the query
182            * @return the number of rows matching the dynamic query
183            */
184            public static long dynamicQueryCount(
185                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
186                    com.liferay.portal.kernel.dao.orm.Projection projection) {
187                    return getService().dynamicQueryCount(dynamicQuery, projection);
188            }
189    
190            public static com.liferay.portlet.trash.model.TrashVersion fetchTrashVersion(
191                    long versionId) {
192                    return getService().fetchTrashVersion(versionId);
193            }
194    
195            public static com.liferay.portlet.trash.model.TrashVersion fetchVersion(
196                    java.lang.String className, long classPK) {
197                    return getService().fetchVersion(className, classPK);
198            }
199    
200            /**
201            * @deprecated As of 7.0.0, replaced by {@link #fetchVersion(String, long)}
202            */
203            @Deprecated
204            public static com.liferay.portlet.trash.model.TrashVersion fetchVersion(
205                    long entryId, java.lang.String className, long classPK) {
206                    return getService().fetchVersion(entryId, className, classPK);
207            }
208    
209            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
210                    return getService().getActionableDynamicQuery();
211            }
212    
213            /**
214            * Returns the Spring bean ID for this bean.
215            *
216            * @return the Spring bean ID for this bean
217            */
218            public static java.lang.String getBeanIdentifier() {
219                    return getService().getBeanIdentifier();
220            }
221    
222            public static com.liferay.portal.model.PersistedModel getPersistedModel(
223                    java.io.Serializable primaryKeyObj)
224                    throws com.liferay.portal.kernel.exception.PortalException {
225                    return getService().getPersistedModel(primaryKeyObj);
226            }
227    
228            /**
229            * Returns the trash version with the primary key.
230            *
231            * @param versionId the primary key of the trash version
232            * @return the trash version
233            * @throws PortalException if a trash version with the primary key could not be found
234            */
235            public static com.liferay.portlet.trash.model.TrashVersion getTrashVersion(
236                    long versionId)
237                    throws com.liferay.portal.kernel.exception.PortalException {
238                    return getService().getTrashVersion(versionId);
239            }
240    
241            /**
242            * Returns a range of all the trash versions.
243            *
244            * <p>
245            * 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.trash.model.impl.TrashVersionModelImpl}. 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.
246            * </p>
247            *
248            * @param start the lower bound of the range of trash versions
249            * @param end the upper bound of the range of trash versions (not inclusive)
250            * @return the range of trash versions
251            */
252            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getTrashVersions(
253                    int start, int end) {
254                    return getService().getTrashVersions(start, end);
255            }
256    
257            /**
258            * Returns the number of trash versions.
259            *
260            * @return the number of trash versions
261            */
262            public static int getTrashVersionsCount() {
263                    return getService().getTrashVersionsCount();
264            }
265    
266            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getVersions(
267                    long entryId) {
268                    return getService().getVersions(entryId);
269            }
270    
271            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getVersions(
272                    long entryId, java.lang.String className) {
273                    return getService().getVersions(entryId, className);
274            }
275    
276            /**
277            * Sets the Spring bean ID for this bean.
278            *
279            * @param beanIdentifier the Spring bean ID for this bean
280            */
281            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
282                    getService().setBeanIdentifier(beanIdentifier);
283            }
284    
285            /**
286            * Updates the trash version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
287            *
288            * @param trashVersion the trash version
289            * @return the trash version that was updated
290            */
291            public static com.liferay.portlet.trash.model.TrashVersion updateTrashVersion(
292                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
293                    return getService().updateTrashVersion(trashVersion);
294            }
295    
296            public static TrashVersionLocalService getService() {
297                    if (_service == null) {
298                            _service = (TrashVersionLocalService)PortalBeanLocatorUtil.locate(TrashVersionLocalService.class.getName());
299    
300                            ReferenceRegistry.registerReference(TrashVersionLocalServiceUtil.class,
301                                    "_service");
302                    }
303    
304                    return _service;
305            }
306    
307            /**
308             * @deprecated As of 6.2.0
309             */
310            @Deprecated
311            public void setService(TrashVersionLocalService service) {
312            }
313    
314            private static TrashVersionLocalService _service;
315    }