001 /** 002 * Copyright (c) 2000-2013 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.portal.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.model.Shard; 020 021 /** 022 * The persistence interface for the shard service. 023 * 024 * <p> 025 * Caching information and settings can be found in <code>portal.properties</code> 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see ShardPersistenceImpl 030 * @see ShardUtil 031 * @generated 032 */ 033 @ProviderType 034 public interface ShardPersistence extends BasePersistence<Shard> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link ShardUtil} to access the shard persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Returns the shard where name = ? or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found. 043 * 044 * @param name the name 045 * @return the matching shard 046 * @throws com.liferay.portal.NoSuchShardException if a matching shard could not be found 047 * @throws SystemException if a system exception occurred 048 */ 049 public com.liferay.portal.model.Shard findByName(java.lang.String name) 050 throws com.liferay.portal.NoSuchShardException, 051 com.liferay.portal.kernel.exception.SystemException; 052 053 /** 054 * Returns the shard where name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 055 * 056 * @param name the name 057 * @return the matching shard, or <code>null</code> if a matching shard could not be found 058 * @throws SystemException if a system exception occurred 059 */ 060 public com.liferay.portal.model.Shard fetchByName(java.lang.String name) 061 throws com.liferay.portal.kernel.exception.SystemException; 062 063 /** 064 * Returns the shard where name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 065 * 066 * @param name the name 067 * @param retrieveFromCache whether to use the finder cache 068 * @return the matching shard, or <code>null</code> if a matching shard could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public com.liferay.portal.model.Shard fetchByName(java.lang.String name, 072 boolean retrieveFromCache) 073 throws com.liferay.portal.kernel.exception.SystemException; 074 075 /** 076 * Removes the shard where name = ? from the database. 077 * 078 * @param name the name 079 * @return the shard that was removed 080 * @throws SystemException if a system exception occurred 081 */ 082 public com.liferay.portal.model.Shard removeByName(java.lang.String name) 083 throws com.liferay.portal.NoSuchShardException, 084 com.liferay.portal.kernel.exception.SystemException; 085 086 /** 087 * Returns the number of shards where name = ?. 088 * 089 * @param name the name 090 * @return the number of matching shards 091 * @throws SystemException if a system exception occurred 092 */ 093 public int countByName(java.lang.String name) 094 throws com.liferay.portal.kernel.exception.SystemException; 095 096 /** 097 * Returns the shard where classNameId = ? and classPK = ? or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found. 098 * 099 * @param classNameId the class name ID 100 * @param classPK the class p k 101 * @return the matching shard 102 * @throws com.liferay.portal.NoSuchShardException if a matching shard could not be found 103 * @throws SystemException if a system exception occurred 104 */ 105 public com.liferay.portal.model.Shard findByC_C(long classNameId, 106 long classPK) 107 throws com.liferay.portal.NoSuchShardException, 108 com.liferay.portal.kernel.exception.SystemException; 109 110 /** 111 * Returns the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 112 * 113 * @param classNameId the class name ID 114 * @param classPK the class p k 115 * @return the matching shard, or <code>null</code> if a matching shard could not be found 116 * @throws SystemException if a system exception occurred 117 */ 118 public com.liferay.portal.model.Shard fetchByC_C(long classNameId, 119 long classPK) 120 throws com.liferay.portal.kernel.exception.SystemException; 121 122 /** 123 * Returns the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 124 * 125 * @param classNameId the class name ID 126 * @param classPK the class p k 127 * @param retrieveFromCache whether to use the finder cache 128 * @return the matching shard, or <code>null</code> if a matching shard could not be found 129 * @throws SystemException if a system exception occurred 130 */ 131 public com.liferay.portal.model.Shard fetchByC_C(long classNameId, 132 long classPK, boolean retrieveFromCache) 133 throws com.liferay.portal.kernel.exception.SystemException; 134 135 /** 136 * Removes the shard where classNameId = ? and classPK = ? from the database. 137 * 138 * @param classNameId the class name ID 139 * @param classPK the class p k 140 * @return the shard that was removed 141 * @throws SystemException if a system exception occurred 142 */ 143 public com.liferay.portal.model.Shard removeByC_C(long classNameId, 144 long classPK) 145 throws com.liferay.portal.NoSuchShardException, 146 com.liferay.portal.kernel.exception.SystemException; 147 148 /** 149 * Returns the number of shards where classNameId = ? and classPK = ?. 150 * 151 * @param classNameId the class name ID 152 * @param classPK the class p k 153 * @return the number of matching shards 154 * @throws SystemException if a system exception occurred 155 */ 156 public int countByC_C(long classNameId, long classPK) 157 throws com.liferay.portal.kernel.exception.SystemException; 158 159 /** 160 * Caches the shard in the entity cache if it is enabled. 161 * 162 * @param shard the shard 163 */ 164 public void cacheResult(com.liferay.portal.model.Shard shard); 165 166 /** 167 * Caches the shards in the entity cache if it is enabled. 168 * 169 * @param shards the shards 170 */ 171 public void cacheResult( 172 java.util.List<com.liferay.portal.model.Shard> shards); 173 174 /** 175 * Creates a new shard with the primary key. Does not add the shard to the database. 176 * 177 * @param shardId the primary key for the new shard 178 * @return the new shard 179 */ 180 public com.liferay.portal.model.Shard create(long shardId); 181 182 /** 183 * Removes the shard with the primary key from the database. Also notifies the appropriate model listeners. 184 * 185 * @param shardId the primary key of the shard 186 * @return the shard that was removed 187 * @throws com.liferay.portal.NoSuchShardException if a shard with the primary key could not be found 188 * @throws SystemException if a system exception occurred 189 */ 190 public com.liferay.portal.model.Shard remove(long shardId) 191 throws com.liferay.portal.NoSuchShardException, 192 com.liferay.portal.kernel.exception.SystemException; 193 194 public com.liferay.portal.model.Shard updateImpl( 195 com.liferay.portal.model.Shard shard) 196 throws com.liferay.portal.kernel.exception.SystemException; 197 198 /** 199 * Returns the shard with the primary key or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found. 200 * 201 * @param shardId the primary key of the shard 202 * @return the shard 203 * @throws com.liferay.portal.NoSuchShardException if a shard with the primary key could not be found 204 * @throws SystemException if a system exception occurred 205 */ 206 public com.liferay.portal.model.Shard findByPrimaryKey(long shardId) 207 throws com.liferay.portal.NoSuchShardException, 208 com.liferay.portal.kernel.exception.SystemException; 209 210 /** 211 * Returns the shard with the primary key or returns <code>null</code> if it could not be found. 212 * 213 * @param shardId the primary key of the shard 214 * @return the shard, or <code>null</code> if a shard with the primary key could not be found 215 * @throws SystemException if a system exception occurred 216 */ 217 public com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId) 218 throws com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * Returns all the shards. 222 * 223 * @return the shards 224 * @throws SystemException if a system exception occurred 225 */ 226 public java.util.List<com.liferay.portal.model.Shard> findAll() 227 throws com.liferay.portal.kernel.exception.SystemException; 228 229 /** 230 * Returns a range of all the shards. 231 * 232 * <p> 233 * 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.portal.model.impl.ShardModelImpl}. 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. 234 * </p> 235 * 236 * @param start the lower bound of the range of shards 237 * @param end the upper bound of the range of shards (not inclusive) 238 * @return the range of shards 239 * @throws SystemException if a system exception occurred 240 */ 241 public java.util.List<com.liferay.portal.model.Shard> findAll(int start, 242 int end) throws com.liferay.portal.kernel.exception.SystemException; 243 244 /** 245 * Returns an ordered range of all the shards. 246 * 247 * <p> 248 * 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.portal.model.impl.ShardModelImpl}. 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. 249 * </p> 250 * 251 * @param start the lower bound of the range of shards 252 * @param end the upper bound of the range of shards (not inclusive) 253 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 254 * @return the ordered range of shards 255 * @throws SystemException if a system exception occurred 256 */ 257 public java.util.List<com.liferay.portal.model.Shard> findAll(int start, 258 int end, 259 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 260 throws com.liferay.portal.kernel.exception.SystemException; 261 262 /** 263 * Removes all the shards from the database. 264 * 265 * @throws SystemException if a system exception occurred 266 */ 267 public void removeAll() 268 throws com.liferay.portal.kernel.exception.SystemException; 269 270 /** 271 * Returns the number of shards. 272 * 273 * @return the number of shards 274 * @throws SystemException if a system exception occurred 275 */ 276 public int countAll() 277 throws com.liferay.portal.kernel.exception.SystemException; 278 }