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