1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.ratings.service.persistence;
21  
22  import com.liferay.portal.service.persistence.BasePersistence;
23  
24  /**
25   * <a href="RatingsEntryPersistence.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   *
29   */
30  public interface RatingsEntryPersistence extends BasePersistence {
31      public void cacheResult(
32          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> ratingsEntries);
36  
37      public void clearCache();
38  
39      public com.liferay.portlet.ratings.model.RatingsEntry create(long entryId);
40  
41      public com.liferay.portlet.ratings.model.RatingsEntry remove(long entryId)
42          throws com.liferay.portal.SystemException,
43              com.liferay.portlet.ratings.NoSuchEntryException;
44  
45      public com.liferay.portlet.ratings.model.RatingsEntry remove(
46          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * @deprecated Use <code>update(RatingsEntry ratingsEntry, boolean merge)</code>.
51       */
52      public com.liferay.portlet.ratings.model.RatingsEntry update(
53          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry)
54          throws com.liferay.portal.SystemException;
55  
56      /**
57       * Add, update, or merge, the entity. This method also calls the model
58       * listeners to trigger the proper events associated with adding, deleting,
59       * or updating an entity.
60       *
61       * @param        ratingsEntry the entity to add, update, or merge
62       * @param        merge boolean value for whether to merge the entity. The
63       *                default value is false. Setting merge to true is more
64       *                expensive and should only be true when ratingsEntry is
65       *                transient. See LEP-5473 for a detailed discussion of this
66       *                method.
67       * @return        true if the portlet can be displayed via Ajax
68       */
69      public com.liferay.portlet.ratings.model.RatingsEntry update(
70          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry,
71          boolean merge) throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portlet.ratings.model.RatingsEntry updateImpl(
74          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry,
75          boolean merge) throws com.liferay.portal.SystemException;
76  
77      public com.liferay.portlet.ratings.model.RatingsEntry findByPrimaryKey(
78          long entryId)
79          throws com.liferay.portal.SystemException,
80              com.liferay.portlet.ratings.NoSuchEntryException;
81  
82      public com.liferay.portlet.ratings.model.RatingsEntry fetchByPrimaryKey(
83          long entryId) throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
86          long classNameId, long classPK)
87          throws com.liferay.portal.SystemException;
88  
89      public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
90          long classNameId, long classPK, int start, int end)
91          throws com.liferay.portal.SystemException;
92  
93      public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
94          long classNameId, long classPK, int start, int end,
95          com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException;
97  
98      public com.liferay.portlet.ratings.model.RatingsEntry findByC_C_First(
99          long classNameId, long classPK,
100         com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.SystemException,
102             com.liferay.portlet.ratings.NoSuchEntryException;
103 
104     public com.liferay.portlet.ratings.model.RatingsEntry findByC_C_Last(
105         long classNameId, long classPK,
106         com.liferay.portal.kernel.util.OrderByComparator obc)
107         throws com.liferay.portal.SystemException,
108             com.liferay.portlet.ratings.NoSuchEntryException;
109 
110     public com.liferay.portlet.ratings.model.RatingsEntry[] findByC_C_PrevAndNext(
111         long entryId, long classNameId, long classPK,
112         com.liferay.portal.kernel.util.OrderByComparator obc)
113         throws com.liferay.portal.SystemException,
114             com.liferay.portlet.ratings.NoSuchEntryException;
115 
116     public com.liferay.portlet.ratings.model.RatingsEntry findByU_C_C(
117         long userId, long classNameId, long classPK)
118         throws com.liferay.portal.SystemException,
119             com.liferay.portlet.ratings.NoSuchEntryException;
120 
121     public com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
122         long userId, long classNameId, long classPK)
123         throws com.liferay.portal.SystemException;
124 
125     public com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
126         long userId, long classNameId, long classPK, boolean retrieveFromCache)
127         throws com.liferay.portal.SystemException;
128 
129     public java.util.List<Object> findWithDynamicQuery(
130         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
131         throws com.liferay.portal.SystemException;
132 
133     public java.util.List<Object> findWithDynamicQuery(
134         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135         int end) throws com.liferay.portal.SystemException;
136 
137     public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll()
138         throws com.liferay.portal.SystemException;
139 
140     public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll(
141         int start, int end) throws com.liferay.portal.SystemException;
142 
143     public java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll(
144         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException;
146 
147     public void removeByC_C(long classNameId, long classPK)
148         throws com.liferay.portal.SystemException;
149 
150     public void removeByU_C_C(long userId, long classNameId, long classPK)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portlet.ratings.NoSuchEntryException;
153 
154     public void removeAll() throws com.liferay.portal.SystemException;
155 
156     public int countByC_C(long classNameId, long classPK)
157         throws com.liferay.portal.SystemException;
158 
159     public int countByU_C_C(long userId, long classNameId, long classPK)
160         throws com.liferay.portal.SystemException;
161 
162     public int countAll() throws com.liferay.portal.SystemException;
163 }