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