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.trash.kernel.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.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * @throws PortalException
057            */
058            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
059                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    return getService().deletePersistedModel(persistedModel);
062            }
063    
064            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
065                    java.io.Serializable primaryKeyObj)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService().getPersistedModel(primaryKeyObj);
068            }
069    
070            /**
071            * Adds the trash version to the database. Also notifies the appropriate model listeners.
072            *
073            * @param trashVersion the trash version
074            * @return the trash version that was added
075            */
076            public static com.liferay.trash.kernel.model.TrashVersion addTrashVersion(
077                    com.liferay.trash.kernel.model.TrashVersion trashVersion) {
078                    return getService().addTrashVersion(trashVersion);
079            }
080    
081            public static com.liferay.trash.kernel.model.TrashVersion addTrashVersion(
082                    long trashEntryId, java.lang.String className, long classPK,
083                    int status,
084                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
085                    return getService()
086                                       .addTrashVersion(trashEntryId, className, classPK, status,
087                            typeSettingsProperties);
088            }
089    
090            /**
091            * Creates a new trash version with the primary key. Does not add the trash version to the database.
092            *
093            * @param versionId the primary key for the new trash version
094            * @return the new trash version
095            */
096            public static com.liferay.trash.kernel.model.TrashVersion createTrashVersion(
097                    long versionId) {
098                    return getService().createTrashVersion(versionId);
099            }
100    
101            /**
102            * Deletes the trash version from the database. Also notifies the appropriate model listeners.
103            *
104            * @param trashVersion the trash version
105            * @return the trash version that was removed
106            */
107            public static com.liferay.trash.kernel.model.TrashVersion deleteTrashVersion(
108                    com.liferay.trash.kernel.model.TrashVersion trashVersion) {
109                    return getService().deleteTrashVersion(trashVersion);
110            }
111    
112            public static com.liferay.trash.kernel.model.TrashVersion deleteTrashVersion(
113                    java.lang.String className, long classPK) {
114                    return getService().deleteTrashVersion(className, classPK);
115            }
116    
117            /**
118            * Deletes the trash version with the primary key from the database. Also notifies the appropriate model listeners.
119            *
120            * @param versionId the primary key of the trash version
121            * @return the trash version that was removed
122            * @throws PortalException if a trash version with the primary key could not be found
123            */
124            public static com.liferay.trash.kernel.model.TrashVersion deleteTrashVersion(
125                    long versionId)
126                    throws com.liferay.portal.kernel.exception.PortalException {
127                    return getService().deleteTrashVersion(versionId);
128            }
129    
130            public static com.liferay.trash.kernel.model.TrashVersion fetchTrashVersion(
131                    long versionId) {
132                    return getService().fetchTrashVersion(versionId);
133            }
134    
135            public static com.liferay.trash.kernel.model.TrashVersion fetchVersion(
136                    java.lang.String className, long classPK) {
137                    return getService().fetchVersion(className, classPK);
138            }
139    
140            /**
141            * @deprecated As of 7.0.0, replaced by {@link #fetchVersion(String, long)}
142            */
143            @Deprecated
144            public static com.liferay.trash.kernel.model.TrashVersion fetchVersion(
145                    long entryId, java.lang.String className, long classPK) {
146                    return getService().fetchVersion(entryId, className, classPK);
147            }
148    
149            /**
150            * Returns the trash version with the primary key.
151            *
152            * @param versionId the primary key of the trash version
153            * @return the trash version
154            * @throws PortalException if a trash version with the primary key could not be found
155            */
156            public static com.liferay.trash.kernel.model.TrashVersion getTrashVersion(
157                    long versionId)
158                    throws com.liferay.portal.kernel.exception.PortalException {
159                    return getService().getTrashVersion(versionId);
160            }
161    
162            /**
163            * Updates the trash version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
164            *
165            * @param trashVersion the trash version
166            * @return the trash version that was updated
167            */
168            public static com.liferay.trash.kernel.model.TrashVersion updateTrashVersion(
169                    com.liferay.trash.kernel.model.TrashVersion trashVersion) {
170                    return getService().updateTrashVersion(trashVersion);
171            }
172    
173            /**
174            * Returns the number of trash versions.
175            *
176            * @return the number of trash versions
177            */
178            public static int getTrashVersionsCount() {
179                    return getService().getTrashVersionsCount();
180            }
181    
182            /**
183            * Returns the OSGi service identifier.
184            *
185            * @return the OSGi service identifier
186            */
187            public static java.lang.String getOSGiServiceIdentifier() {
188                    return getService().getOSGiServiceIdentifier();
189            }
190    
191            /**
192            * Performs a dynamic query on the database and returns the matching rows.
193            *
194            * @param dynamicQuery the dynamic query
195            * @return the matching rows
196            */
197            public static <T> java.util.List<T> dynamicQuery(
198                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
199                    return getService().dynamicQuery(dynamicQuery);
200            }
201    
202            /**
203            * Performs a dynamic query on the database and returns a range of the matching rows.
204            *
205            * <p>
206            * 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.
207            * </p>
208            *
209            * @param dynamicQuery the dynamic query
210            * @param start the lower bound of the range of model instances
211            * @param end the upper bound of the range of model instances (not inclusive)
212            * @return the range of matching rows
213            */
214            public static <T> java.util.List<T> dynamicQuery(
215                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
216                    int end) {
217                    return getService().dynamicQuery(dynamicQuery, start, end);
218            }
219    
220            /**
221            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
222            *
223            * <p>
224            * 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.
225            * </p>
226            *
227            * @param dynamicQuery the dynamic query
228            * @param start the lower bound of the range of model instances
229            * @param end the upper bound of the range of model instances (not inclusive)
230            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
231            * @return the ordered range of matching rows
232            */
233            public static <T> java.util.List<T> dynamicQuery(
234                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
235                    int end,
236                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
237                    return getService()
238                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
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.trash.kernel.model.TrashVersion> getTrashVersions(
253                    int start, int end) {
254                    return getService().getTrashVersions(start, end);
255            }
256    
257            public static java.util.List<com.liferay.trash.kernel.model.TrashVersion> getVersions(
258                    long entryId) {
259                    return getService().getVersions(entryId);
260            }
261    
262            public static java.util.List<com.liferay.trash.kernel.model.TrashVersion> getVersions(
263                    long entryId, java.lang.String className) {
264                    return getService().getVersions(entryId, className);
265            }
266    
267            /**
268            * Returns the number of rows matching the dynamic query.
269            *
270            * @param dynamicQuery the dynamic query
271            * @return the number of rows matching the dynamic query
272            */
273            public static long dynamicQueryCount(
274                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
275                    return getService().dynamicQueryCount(dynamicQuery);
276            }
277    
278            /**
279            * Returns the number of rows matching the dynamic query.
280            *
281            * @param dynamicQuery the dynamic query
282            * @param projection the projection to apply to the query
283            * @return the number of rows matching the dynamic query
284            */
285            public static long dynamicQueryCount(
286                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
287                    com.liferay.portal.kernel.dao.orm.Projection projection) {
288                    return getService().dynamicQueryCount(dynamicQuery, projection);
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    }