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.dynamicdatamapping.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the d d m template version service. This utility wraps {@link DDMTemplateVersionPersistenceImpl} 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.
031     *
032     * <p>
033     * Caching information and settings can be found in <code>portal.properties</code>
034     * </p>
035     *
036     * @author Brian Wing Shun Chan
037     * @see DDMTemplateVersionPersistence
038     * @see DDMTemplateVersionPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class DDMTemplateVersionUtil {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
047             */
048    
049            /**
050             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
051             */
052            public static void clearCache() {
053                    getPersistence().clearCache();
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
058             */
059            public static void clearCache(DDMTemplateVersion ddmTemplateVersion) {
060                    getPersistence().clearCache(ddmTemplateVersion);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
067                    return getPersistence().countWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
072             */
073            public static List<DDMTemplateVersion> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery) {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
080             */
081            public static List<DDMTemplateVersion> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end) {
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<DDMTemplateVersion> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator<DDMTemplateVersion> orderByComparator) {
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 DDMTemplateVersion update(
101                    DDMTemplateVersion ddmTemplateVersion) {
102                    return getPersistence().update(ddmTemplateVersion);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static DDMTemplateVersion update(
109                    DDMTemplateVersion ddmTemplateVersion, ServiceContext serviceContext) {
110                    return getPersistence().update(ddmTemplateVersion, serviceContext);
111            }
112    
113            /**
114            * Returns all the d d m template versions where templateId = &#63;.
115            *
116            * @param templateId the template ID
117            * @return the matching d d m template versions
118            */
119            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findByTemplateId(
120                    long templateId) {
121                    return getPersistence().findByTemplateId(templateId);
122            }
123    
124            /**
125            * Returns a range of all the d d m template versions where templateId = &#63;.
126            *
127            * <p>
128            * 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.dynamicdatamapping.model.impl.DDMTemplateVersionModelImpl}. 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.
129            * </p>
130            *
131            * @param templateId the template ID
132            * @param start the lower bound of the range of d d m template versions
133            * @param end the upper bound of the range of d d m template versions (not inclusive)
134            * @return the range of matching d d m template versions
135            */
136            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findByTemplateId(
137                    long templateId, int start, int end) {
138                    return getPersistence().findByTemplateId(templateId, start, end);
139            }
140    
141            /**
142            * Returns an ordered range of all the d d m template versions where templateId = &#63;.
143            *
144            * <p>
145            * 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.dynamicdatamapping.model.impl.DDMTemplateVersionModelImpl}. 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.
146            * </p>
147            *
148            * @param templateId the template ID
149            * @param start the lower bound of the range of d d m template versions
150            * @param end the upper bound of the range of d d m template versions (not inclusive)
151            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
152            * @return the ordered range of matching d d m template versions
153            */
154            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findByTemplateId(
155                    long templateId, int start, int end,
156                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator) {
157                    return getPersistence()
158                                       .findByTemplateId(templateId, start, end, orderByComparator);
159            }
160    
161            /**
162            * Returns the first d d m template version in the ordered set where templateId = &#63;.
163            *
164            * @param templateId the template ID
165            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
166            * @return the first matching d d m template version
167            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a matching d d m template version could not be found
168            */
169            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion findByTemplateId_First(
170                    long templateId,
171                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator)
172                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
173                    return getPersistence()
174                                       .findByTemplateId_First(templateId, orderByComparator);
175            }
176    
177            /**
178            * Returns the first d d m template version in the ordered set where templateId = &#63;.
179            *
180            * @param templateId the template ID
181            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
182            * @return the first matching d d m template version, or <code>null</code> if a matching d d m template version could not be found
183            */
184            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion fetchByTemplateId_First(
185                    long templateId,
186                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator) {
187                    return getPersistence()
188                                       .fetchByTemplateId_First(templateId, orderByComparator);
189            }
190    
191            /**
192            * Returns the last d d m template version in the ordered set where templateId = &#63;.
193            *
194            * @param templateId the template ID
195            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
196            * @return the last matching d d m template version
197            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a matching d d m template version could not be found
198            */
199            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion findByTemplateId_Last(
200                    long templateId,
201                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator)
202                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
203                    return getPersistence()
204                                       .findByTemplateId_Last(templateId, orderByComparator);
205            }
206    
207            /**
208            * Returns the last d d m template version in the ordered set where templateId = &#63;.
209            *
210            * @param templateId the template ID
211            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
212            * @return the last matching d d m template version, or <code>null</code> if a matching d d m template version could not be found
213            */
214            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion fetchByTemplateId_Last(
215                    long templateId,
216                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator) {
217                    return getPersistence()
218                                       .fetchByTemplateId_Last(templateId, orderByComparator);
219            }
220    
221            /**
222            * Returns the d d m template versions before and after the current d d m template version in the ordered set where templateId = &#63;.
223            *
224            * @param templateVersionId the primary key of the current d d m template version
225            * @param templateId the template ID
226            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
227            * @return the previous, current, and next d d m template version
228            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a d d m template version with the primary key could not be found
229            */
230            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion[] findByTemplateId_PrevAndNext(
231                    long templateVersionId, long templateId,
232                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator)
233                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
234                    return getPersistence()
235                                       .findByTemplateId_PrevAndNext(templateVersionId, templateId,
236                            orderByComparator);
237            }
238    
239            /**
240            * Removes all the d d m template versions where templateId = &#63; from the database.
241            *
242            * @param templateId the template ID
243            */
244            public static void removeByTemplateId(long templateId) {
245                    getPersistence().removeByTemplateId(templateId);
246            }
247    
248            /**
249            * Returns the number of d d m template versions where templateId = &#63;.
250            *
251            * @param templateId the template ID
252            * @return the number of matching d d m template versions
253            */
254            public static int countByTemplateId(long templateId) {
255                    return getPersistence().countByTemplateId(templateId);
256            }
257    
258            /**
259            * Returns the d d m template version where templateId = &#63; and version = &#63; or throws a {@link com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException} if it could not be found.
260            *
261            * @param templateId the template ID
262            * @param version the version
263            * @return the matching d d m template version
264            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a matching d d m template version could not be found
265            */
266            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion findByT_V(
267                    long templateId, java.lang.String version)
268                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
269                    return getPersistence().findByT_V(templateId, version);
270            }
271    
272            /**
273            * Returns the d d m template version where templateId = &#63; and version = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
274            *
275            * @param templateId the template ID
276            * @param version the version
277            * @return the matching d d m template version, or <code>null</code> if a matching d d m template version could not be found
278            */
279            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion fetchByT_V(
280                    long templateId, java.lang.String version) {
281                    return getPersistence().fetchByT_V(templateId, version);
282            }
283    
284            /**
285            * Returns the d d m template version where templateId = &#63; and version = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
286            *
287            * @param templateId the template ID
288            * @param version the version
289            * @param retrieveFromCache whether to use the finder cache
290            * @return the matching d d m template version, or <code>null</code> if a matching d d m template version could not be found
291            */
292            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion fetchByT_V(
293                    long templateId, java.lang.String version, boolean retrieveFromCache) {
294                    return getPersistence()
295                                       .fetchByT_V(templateId, version, retrieveFromCache);
296            }
297    
298            /**
299            * Removes the d d m template version where templateId = &#63; and version = &#63; from the database.
300            *
301            * @param templateId the template ID
302            * @param version the version
303            * @return the d d m template version that was removed
304            */
305            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion removeByT_V(
306                    long templateId, java.lang.String version)
307                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
308                    return getPersistence().removeByT_V(templateId, version);
309            }
310    
311            /**
312            * Returns the number of d d m template versions where templateId = &#63; and version = &#63;.
313            *
314            * @param templateId the template ID
315            * @param version the version
316            * @return the number of matching d d m template versions
317            */
318            public static int countByT_V(long templateId, java.lang.String version) {
319                    return getPersistence().countByT_V(templateId, version);
320            }
321    
322            /**
323            * Caches the d d m template version in the entity cache if it is enabled.
324            *
325            * @param ddmTemplateVersion the d d m template version
326            */
327            public static void cacheResult(
328                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion ddmTemplateVersion) {
329                    getPersistence().cacheResult(ddmTemplateVersion);
330            }
331    
332            /**
333            * Caches the d d m template versions in the entity cache if it is enabled.
334            *
335            * @param ddmTemplateVersions the d d m template versions
336            */
337            public static void cacheResult(
338                    java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> ddmTemplateVersions) {
339                    getPersistence().cacheResult(ddmTemplateVersions);
340            }
341    
342            /**
343            * Creates a new d d m template version with the primary key. Does not add the d d m template version to the database.
344            *
345            * @param templateVersionId the primary key for the new d d m template version
346            * @return the new d d m template version
347            */
348            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion create(
349                    long templateVersionId) {
350                    return getPersistence().create(templateVersionId);
351            }
352    
353            /**
354            * Removes the d d m template version with the primary key from the database. Also notifies the appropriate model listeners.
355            *
356            * @param templateVersionId the primary key of the d d m template version
357            * @return the d d m template version that was removed
358            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a d d m template version with the primary key could not be found
359            */
360            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion remove(
361                    long templateVersionId)
362                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
363                    return getPersistence().remove(templateVersionId);
364            }
365    
366            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion updateImpl(
367                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion ddmTemplateVersion) {
368                    return getPersistence().updateImpl(ddmTemplateVersion);
369            }
370    
371            /**
372            * Returns the d d m template version with the primary key or throws a {@link com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException} if it could not be found.
373            *
374            * @param templateVersionId the primary key of the d d m template version
375            * @return the d d m template version
376            * @throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException if a d d m template version with the primary key could not be found
377            */
378            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion findByPrimaryKey(
379                    long templateVersionId)
380                    throws com.liferay.portlet.dynamicdatamapping.NoSuchTemplateVersionException {
381                    return getPersistence().findByPrimaryKey(templateVersionId);
382            }
383    
384            /**
385            * Returns the d d m template version with the primary key or returns <code>null</code> if it could not be found.
386            *
387            * @param templateVersionId the primary key of the d d m template version
388            * @return the d d m template version, or <code>null</code> if a d d m template version with the primary key could not be found
389            */
390            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion fetchByPrimaryKey(
391                    long templateVersionId) {
392                    return getPersistence().fetchByPrimaryKey(templateVersionId);
393            }
394    
395            public static java.util.Map<java.io.Serializable, com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> fetchByPrimaryKeys(
396                    java.util.Set<java.io.Serializable> primaryKeys) {
397                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
398            }
399    
400            /**
401            * Returns all the d d m template versions.
402            *
403            * @return the d d m template versions
404            */
405            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findAll() {
406                    return getPersistence().findAll();
407            }
408    
409            /**
410            * Returns a range of all the d d m template versions.
411            *
412            * <p>
413            * 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.dynamicdatamapping.model.impl.DDMTemplateVersionModelImpl}. 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.
414            * </p>
415            *
416            * @param start the lower bound of the range of d d m template versions
417            * @param end the upper bound of the range of d d m template versions (not inclusive)
418            * @return the range of d d m template versions
419            */
420            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findAll(
421                    int start, int end) {
422                    return getPersistence().findAll(start, end);
423            }
424    
425            /**
426            * Returns an ordered range of all the d d m template versions.
427            *
428            * <p>
429            * 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.dynamicdatamapping.model.impl.DDMTemplateVersionModelImpl}. 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.
430            * </p>
431            *
432            * @param start the lower bound of the range of d d m template versions
433            * @param end the upper bound of the range of d d m template versions (not inclusive)
434            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
435            * @return the ordered range of d d m template versions
436            */
437            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> findAll(
438                    int start, int end,
439                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.dynamicdatamapping.model.DDMTemplateVersion> orderByComparator) {
440                    return getPersistence().findAll(start, end, orderByComparator);
441            }
442    
443            /**
444            * Removes all the d d m template versions from the database.
445            */
446            public static void removeAll() {
447                    getPersistence().removeAll();
448            }
449    
450            /**
451            * Returns the number of d d m template versions.
452            *
453            * @return the number of d d m template versions
454            */
455            public static int countAll() {
456                    return getPersistence().countAll();
457            }
458    
459            public static DDMTemplateVersionPersistence getPersistence() {
460                    if (_persistence == null) {
461                            _persistence = (DDMTemplateVersionPersistence)PortalBeanLocatorUtil.locate(DDMTemplateVersionPersistence.class.getName());
462    
463                            ReferenceRegistry.registerReference(DDMTemplateVersionUtil.class,
464                                    "_persistence");
465                    }
466    
467                    return _persistence;
468            }
469    
470            /**
471             * @deprecated As of 6.2.0
472             */
473            @Deprecated
474            public void setPersistence(DDMTemplateVersionPersistence persistence) {
475            }
476    
477            private static DDMTemplateVersionPersistence _persistence;
478    }