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.ratings.kernel.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.service.persistence.BasePersistence; 020 021 import com.liferay.ratings.kernel.exception.NoSuchStatsException; 022 import com.liferay.ratings.kernel.model.RatingsStats; 023 024 /** 025 * The persistence interface for the ratings stats service. 026 * 027 * <p> 028 * Caching information and settings can be found in <code>portal.properties</code> 029 * </p> 030 * 031 * @author Brian Wing Shun Chan 032 * @see com.liferay.portlet.ratings.service.persistence.impl.RatingsStatsPersistenceImpl 033 * @see RatingsStatsUtil 034 * @generated 035 */ 036 @ProviderType 037 public interface RatingsStatsPersistence extends BasePersistence<RatingsStats> { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * 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. 042 */ 043 044 /** 045 * Returns the ratings stats where classNameId = ? and classPK = ? or throws a {@link NoSuchStatsException} if it could not be found. 046 * 047 * @param classNameId the class name ID 048 * @param classPK the class p k 049 * @return the matching ratings stats 050 * @throws NoSuchStatsException if a matching ratings stats could not be found 051 */ 052 public RatingsStats findByC_C(long classNameId, long classPK) 053 throws NoSuchStatsException; 054 055 /** 056 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 057 * 058 * @param classNameId the class name ID 059 * @param classPK the class p k 060 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 061 */ 062 public RatingsStats fetchByC_C(long classNameId, long classPK); 063 064 /** 065 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 066 * 067 * @param classNameId the class name ID 068 * @param classPK the class p k 069 * @param retrieveFromCache whether to retrieve from the finder cache 070 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 071 */ 072 public RatingsStats fetchByC_C(long classNameId, long classPK, 073 boolean retrieveFromCache); 074 075 /** 076 * Removes the ratings stats where classNameId = ? and classPK = ? from the database. 077 * 078 * @param classNameId the class name ID 079 * @param classPK the class p k 080 * @return the ratings stats that was removed 081 */ 082 public RatingsStats removeByC_C(long classNameId, long classPK) 083 throws NoSuchStatsException; 084 085 /** 086 * Returns the number of ratings statses where classNameId = ? and classPK = ?. 087 * 088 * @param classNameId the class name ID 089 * @param classPK the class p k 090 * @return the number of matching ratings statses 091 */ 092 public int countByC_C(long classNameId, long classPK); 093 094 /** 095 * Caches the ratings stats in the entity cache if it is enabled. 096 * 097 * @param ratingsStats the ratings stats 098 */ 099 public void cacheResult(RatingsStats ratingsStats); 100 101 /** 102 * Caches the ratings statses in the entity cache if it is enabled. 103 * 104 * @param ratingsStatses the ratings statses 105 */ 106 public void cacheResult(java.util.List<RatingsStats> ratingsStatses); 107 108 /** 109 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 110 * 111 * @param statsId the primary key for the new ratings stats 112 * @return the new ratings stats 113 */ 114 public RatingsStats create(long statsId); 115 116 /** 117 * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 118 * 119 * @param statsId the primary key of the ratings stats 120 * @return the ratings stats that was removed 121 * @throws NoSuchStatsException if a ratings stats with the primary key could not be found 122 */ 123 public RatingsStats remove(long statsId) throws 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 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 }