001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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 to cache 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 to cache 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds the shard where name = ? or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found. 102 * 103 * @param name the name to search with 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 * Finds 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 to search with 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 * Finds 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 to search with 126 * @return the matching shard, or <code>null</code> if a matching shard could not be found 127 * @throws SystemException if a system exception occurred 128 */ 129 public com.liferay.portal.model.Shard fetchByName(java.lang.String name, 130 boolean retrieveFromCache) 131 throws com.liferay.portal.kernel.exception.SystemException; 132 133 /** 134 * Finds the shard where classNameId = ? and classPK = ? or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found. 135 * 136 * @param classNameId the class name ID to search with 137 * @param classPK the class p k to search with 138 * @return the matching shard 139 * @throws com.liferay.portal.NoSuchShardException if a matching shard could not be found 140 * @throws SystemException if a system exception occurred 141 */ 142 public com.liferay.portal.model.Shard findByC_C(long classNameId, 143 long classPK) 144 throws com.liferay.portal.NoSuchShardException, 145 com.liferay.portal.kernel.exception.SystemException; 146 147 /** 148 * Finds the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 149 * 150 * @param classNameId the class name ID to search with 151 * @param classPK the class p k to search with 152 * @return the matching shard, or <code>null</code> if a matching shard could not be found 153 * @throws SystemException if a system exception occurred 154 */ 155 public com.liferay.portal.model.Shard fetchByC_C(long classNameId, 156 long classPK) 157 throws com.liferay.portal.kernel.exception.SystemException; 158 159 /** 160 * Finds the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 161 * 162 * @param classNameId the class name ID to search with 163 * @param classPK the class p k to search with 164 * @return the matching shard, or <code>null</code> if a matching shard could not be found 165 * @throws SystemException if a system exception occurred 166 */ 167 public com.liferay.portal.model.Shard fetchByC_C(long classNameId, 168 long classPK, boolean retrieveFromCache) 169 throws com.liferay.portal.kernel.exception.SystemException; 170 171 /** 172 * Finds all the shards. 173 * 174 * @return the shards 175 * @throws SystemException if a system exception occurred 176 */ 177 public java.util.List<com.liferay.portal.model.Shard> findAll() 178 throws com.liferay.portal.kernel.exception.SystemException; 179 180 /** 181 * Finds a range of all the shards. 182 * 183 * <p> 184 * 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. 185 * </p> 186 * 187 * @param start the lower bound of the range of shards to return 188 * @param end the upper bound of the range of shards to return (not inclusive) 189 * @return the range of shards 190 * @throws SystemException if a system exception occurred 191 */ 192 public java.util.List<com.liferay.portal.model.Shard> findAll(int start, 193 int end) throws com.liferay.portal.kernel.exception.SystemException; 194 195 /** 196 * Finds an ordered range of all the shards. 197 * 198 * <p> 199 * 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. 200 * </p> 201 * 202 * @param start the lower bound of the range of shards to return 203 * @param end the upper bound of the range of shards to return (not inclusive) 204 * @param orderByComparator the comparator to order the results by 205 * @return the ordered range of shards 206 * @throws SystemException if a system exception occurred 207 */ 208 public java.util.List<com.liferay.portal.model.Shard> findAll(int start, 209 int end, 210 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 211 throws com.liferay.portal.kernel.exception.SystemException; 212 213 /** 214 * Removes the shard where name = ? from the database. 215 * 216 * @param name the name to search with 217 * @throws SystemException if a system exception occurred 218 */ 219 public void removeByName(java.lang.String name) 220 throws com.liferay.portal.NoSuchShardException, 221 com.liferay.portal.kernel.exception.SystemException; 222 223 /** 224 * Removes the shard where classNameId = ? and classPK = ? from the database. 225 * 226 * @param classNameId the class name ID to search with 227 * @param classPK the class p k to search with 228 * @throws SystemException if a system exception occurred 229 */ 230 public void removeByC_C(long classNameId, long classPK) 231 throws com.liferay.portal.NoSuchShardException, 232 com.liferay.portal.kernel.exception.SystemException; 233 234 /** 235 * Removes all the shards from the database. 236 * 237 * @throws SystemException if a system exception occurred 238 */ 239 public void removeAll() 240 throws com.liferay.portal.kernel.exception.SystemException; 241 242 /** 243 * Counts all the shards where name = ?. 244 * 245 * @param name the name to search with 246 * @return the number of matching shards 247 * @throws SystemException if a system exception occurred 248 */ 249 public int countByName(java.lang.String name) 250 throws com.liferay.portal.kernel.exception.SystemException; 251 252 /** 253 * Counts all the shards where classNameId = ? and classPK = ?. 254 * 255 * @param classNameId the class name ID to search with 256 * @param classPK the class p k to search with 257 * @return the number of matching shards 258 * @throws SystemException if a system exception occurred 259 */ 260 public int countByC_C(long classNameId, long classPK) 261 throws com.liferay.portal.kernel.exception.SystemException; 262 263 /** 264 * Counts all the shards. 265 * 266 * @return the number of shards 267 * @throws SystemException if a system exception occurred 268 */ 269 public int countAll() 270 throws com.liferay.portal.kernel.exception.SystemException; 271 272 public Shard remove(Shard shard) throws SystemException; 273 }