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            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
214                    return getService().getIndexableActionableDynamicQuery();
215            }
216    
217            /**
218            * Returns the OSGi service identifier.
219            *
220            * @return the OSGi service identifier
221            */
222            public static java.lang.String getOSGiServiceIdentifier() {
223                    return getService().getOSGiServiceIdentifier();
224            }
225    
226            public static com.liferay.portal.model.PersistedModel getPersistedModel(
227                    java.io.Serializable primaryKeyObj)
228                    throws com.liferay.portal.kernel.exception.PortalException {
229                    return getService().getPersistedModel(primaryKeyObj);
230            }
231    
232            /**
233            * Returns the trash version with the primary key.
234            *
235            * @param versionId the primary key of the trash version
236            * @return the trash version
237            * @throws PortalException if a trash version with the primary key could not be found
238            */
239            public static com.liferay.portlet.trash.model.TrashVersion getTrashVersion(
240                    long versionId)
241                    throws com.liferay.portal.kernel.exception.PortalException {
242                    return getService().getTrashVersion(versionId);
243            }
244    
245            /**
246            * Returns a range of all the trash versions.
247            *
248            * <p>
249            * 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.
250            * </p>
251            *
252            * @param start the lower bound of the range of trash versions
253            * @param end the upper bound of the range of trash versions (not inclusive)
254            * @return the range of trash versions
255            */
256            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getTrashVersions(
257                    int start, int end) {
258                    return getService().getTrashVersions(start, end);
259            }
260    
261            /**
262            * Returns the number of trash versions.
263            *
264            * @return the number of trash versions
265            */
266            public static int getTrashVersionsCount() {
267                    return getService().getTrashVersionsCount();
268            }
269    
270            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getVersions(
271                    long entryId) {
272                    return getService().getVersions(entryId);
273            }
274    
275            public static java.util.List<com.liferay.portlet.trash.model.TrashVersion> getVersions(
276                    long entryId, java.lang.String className) {
277                    return getService().getVersions(entryId, className);
278            }
279    
280            /**
281            * Updates the trash version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
282            *
283            * @param trashVersion the trash version
284            * @return the trash version that was updated
285            */
286            public static com.liferay.portlet.trash.model.TrashVersion updateTrashVersion(
287                    com.liferay.portlet.trash.model.TrashVersion trashVersion) {
288                    return getService().updateTrashVersion(trashVersion);
289            }
290    
291            public static TrashVersionLocalService getService() {
292                    if (_service == null) {
293                            _service = (TrashVersionLocalService)PortalBeanLocatorUtil.locate(TrashVersionLocalService.class.getName());
294    
295                            ReferenceRegistry.registerReference(TrashVersionLocalServiceUtil.class,
296                                    "_service");
297                    }
298    
299                    return _service;
300            }
301    
302            private static TrashVersionLocalService _service;
303    }