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