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.ratings.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.service.persistence.BasePersistence; 020 021 import com.liferay.portlet.ratings.model.RatingsStats; 022 023 /** 024 * The persistence interface for the ratings stats 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.ratings.service.persistence.impl.RatingsStatsPersistenceImpl 032 * @see RatingsStatsUtil 033 * @generated 034 */ 035 @ProviderType 036 public interface RatingsStatsPersistence extends BasePersistence<RatingsStats> { 037 /* 038 * NOTE FOR DEVELOPERS: 039 * 040 * Never modify or reference this interface directly. Always use {@link RatingsStatsUtil} to access the ratings stats persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 041 */ 042 043 /** 044 * Returns the ratings stats where classNameId = ? and classPK = ? or throws a {@link NoSuchStatsException} if it could not be found. 045 * 046 * @param classNameId the class name ID 047 * @param classPK the class p k 048 * @return the matching ratings stats 049 * @throws NoSuchStatsException if a matching ratings stats could not be found 050 */ 051 public RatingsStats findByC_C(long classNameId, long classPK) 052 throws com.liferay.portlet.ratings.exception.NoSuchStatsException; 053 054 /** 055 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 056 * 057 * @param classNameId the class name ID 058 * @param classPK the class p k 059 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 060 */ 061 public RatingsStats fetchByC_C(long classNameId, long classPK); 062 063 /** 064 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 065 * 066 * @param classNameId the class name ID 067 * @param classPK the class p k 068 * @param retrieveFromCache whether to retrieve from the finder cache 069 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 070 */ 071 public RatingsStats fetchByC_C(long classNameId, long classPK, 072 boolean retrieveFromCache); 073 074 /** 075 * Removes the ratings stats where classNameId = ? and classPK = ? from the database. 076 * 077 * @param classNameId the class name ID 078 * @param classPK the class p k 079 * @return the ratings stats that was removed 080 */ 081 public RatingsStats removeByC_C(long classNameId, long classPK) 082 throws com.liferay.portlet.ratings.exception.NoSuchStatsException; 083 084 /** 085 * Returns the number of ratings statses where classNameId = ? and classPK = ?. 086 * 087 * @param classNameId the class name ID 088 * @param classPK the class p k 089 * @return the number of matching ratings statses 090 */ 091 public int countByC_C(long classNameId, long classPK); 092 093 /** 094 * Caches the ratings stats in the entity cache if it is enabled. 095 * 096 * @param ratingsStats the ratings stats 097 */ 098 public void cacheResult(RatingsStats ratingsStats); 099 100 /** 101 * Caches the ratings statses in the entity cache if it is enabled. 102 * 103 * @param ratingsStatses the ratings statses 104 */ 105 public void cacheResult(java.util.List<RatingsStats> ratingsStatses); 106 107 /** 108 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 109 * 110 * @param statsId the primary key for the new ratings stats 111 * @return the new ratings stats 112 */ 113 public RatingsStats create(long statsId); 114 115 /** 116 * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 117 * 118 * @param statsId the primary key of the ratings stats 119 * @return the ratings stats that was removed 120 * @throws NoSuchStatsException if a ratings stats with the primary key could not be found 121 */ 122 public RatingsStats remove(long statsId) 123 throws com.liferay.portlet.ratings.exception.NoSuchStatsException; 124 125 public RatingsStats updateImpl(RatingsStats ratingsStats); 126 127 /** 128 * Returns the ratings stats with the primary key or throws a {@link NoSuchStatsException} if it could not be found. 129 * 130 * @param statsId the primary key of the ratings stats 131 * @return the ratings stats 132 * @throws NoSuchStatsException if a ratings stats with the primary key could not be found 133 */ 134 public RatingsStats findByPrimaryKey(long statsId) 135 throws com.liferay.portlet.ratings.exception.NoSuchStatsException; 136 137 /** 138 * Returns the ratings stats with the primary key or returns <code>null</code> if it could not be found. 139 * 140 * @param statsId the primary key of the ratings stats 141 * @return the ratings stats, or <code>null</code> if a ratings stats with the primary key could not be found 142 */ 143 public RatingsStats fetchByPrimaryKey(long statsId); 144 145 @Override 146 public java.util.Map<java.io.Serializable, RatingsStats> fetchByPrimaryKeys( 147 java.util.Set<java.io.Serializable> primaryKeys); 148 149 /** 150 * Returns all the ratings statses. 151 * 152 * @return the ratings statses 153 */ 154 public java.util.List<RatingsStats> findAll(); 155 156 /** 157 * Returns a range of all the ratings statses. 158 * 159 * <p> 160 * 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 RatingsStatsModelImpl}. 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. 161 * </p> 162 * 163 * @param start the lower bound of the range of ratings statses 164 * @param end the upper bound of the range of ratings statses (not inclusive) 165 * @return the range of ratings statses 166 */ 167 public java.util.List<RatingsStats> findAll(int start, int end); 168 169 /** 170 * Returns an ordered range of all the ratings statses. 171 * 172 * <p> 173 * 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 RatingsStatsModelImpl}. 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. 174 * </p> 175 * 176 * @param start the lower bound of the range of ratings statses 177 * @param end the upper bound of the range of ratings statses (not inclusive) 178 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 179 * @return the ordered range of ratings statses 180 */ 181 public java.util.List<RatingsStats> findAll(int start, int end, 182 com.liferay.portal.kernel.util.OrderByComparator<RatingsStats> orderByComparator); 183 184 /** 185 * Returns an ordered range of all the ratings statses. 186 * 187 * <p> 188 * 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 RatingsStatsModelImpl}. 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. 189 * </p> 190 * 191 * @param start the lower bound of the range of ratings statses 192 * @param end the upper bound of the range of ratings statses (not inclusive) 193 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 194 * @param retrieveFromCache whether to retrieve from the finder cache 195 * @return the ordered range of ratings statses 196 */ 197 public java.util.List<RatingsStats> findAll(int start, int end, 198 com.liferay.portal.kernel.util.OrderByComparator<RatingsStats> orderByComparator, 199 boolean retrieveFromCache); 200 201 /** 202 * Removes all the ratings statses from the database. 203 */ 204 public void removeAll(); 205 206 /** 207 * Returns the number of ratings statses. 208 * 209 * @return the number of ratings statses 210 */ 211 public int countAll(); 212 }