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