001 /** 002 * Copyright (c) 2000-present 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 com.liferay.portal.service.persistence.impl.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 NoSuchShardException} if it could not be found. 043 * 044 * @param name the name 045 * @return the matching shard 046 * @throws NoSuchShardException if a matching shard could not be found 047 */ 048 public Shard findByName(java.lang.String name) 049 throws com.liferay.portal.NoSuchShardException; 050 051 /** 052 * Returns the shard where name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 053 * 054 * @param name the name 055 * @return the matching shard, or <code>null</code> if a matching shard could not be found 056 */ 057 public Shard fetchByName(java.lang.String name); 058 059 /** 060 * Returns the shard where name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 061 * 062 * @param name the name 063 * @param retrieveFromCache whether to use the finder cache 064 * @return the matching shard, or <code>null</code> if a matching shard could not be found 065 */ 066 public Shard fetchByName(java.lang.String name, boolean retrieveFromCache); 067 068 /** 069 * Removes the shard where name = ? from the database. 070 * 071 * @param name the name 072 * @return the shard that was removed 073 */ 074 public Shard removeByName(java.lang.String name) 075 throws com.liferay.portal.NoSuchShardException; 076 077 /** 078 * Returns the number of shards where name = ?. 079 * 080 * @param name the name 081 * @return the number of matching shards 082 */ 083 public int countByName(java.lang.String name); 084 085 /** 086 * Returns the shard where classNameId = ? and classPK = ? or throws a {@link NoSuchShardException} if it could not be found. 087 * 088 * @param classNameId the class name ID 089 * @param classPK the class p k 090 * @return the matching shard 091 * @throws NoSuchShardException if a matching shard could not be found 092 */ 093 public Shard findByC_C(long classNameId, long classPK) 094 throws com.liferay.portal.NoSuchShardException; 095 096 /** 097 * Returns the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 098 * 099 * @param classNameId the class name ID 100 * @param classPK the class p k 101 * @return the matching shard, or <code>null</code> if a matching shard could not be found 102 */ 103 public Shard fetchByC_C(long classNameId, long classPK); 104 105 /** 106 * Returns the shard where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 107 * 108 * @param classNameId the class name ID 109 * @param classPK the class p k 110 * @param retrieveFromCache whether to use the finder cache 111 * @return the matching shard, or <code>null</code> if a matching shard could not be found 112 */ 113 public Shard fetchByC_C(long classNameId, long classPK, 114 boolean retrieveFromCache); 115 116 /** 117 * Removes the shard where classNameId = ? and classPK = ? from the database. 118 * 119 * @param classNameId the class name ID 120 * @param classPK the class p k 121 * @return the shard that was removed 122 */ 123 public Shard removeByC_C(long classNameId, long classPK) 124 throws com.liferay.portal.NoSuchShardException; 125 126 /** 127 * Returns the number of shards where classNameId = ? and classPK = ?. 128 * 129 * @param classNameId the class name ID 130 * @param classPK the class p k 131 * @return the number of matching shards 132 */ 133 public int countByC_C(long classNameId, long classPK); 134 135 /** 136 * Caches the shard in the entity cache if it is enabled. 137 * 138 * @param shard the shard 139 */ 140 public void cacheResult(Shard shard); 141 142 /** 143 * Caches the shards in the entity cache if it is enabled. 144 * 145 * @param shards the shards 146 */ 147 public void cacheResult(java.util.List<Shard> shards); 148 149 /** 150 * Creates a new shard with the primary key. Does not add the shard to the database. 151 * 152 * @param shardId the primary key for the new shard 153 * @return the new shard 154 */ 155 public Shard create(long shardId); 156 157 /** 158 * Removes the shard with the primary key from the database. Also notifies the appropriate model listeners. 159 * 160 * @param shardId the primary key of the shard 161 * @return the shard that was removed 162 * @throws NoSuchShardException if a shard with the primary key could not be found 163 */ 164 public Shard remove(long shardId) 165 throws com.liferay.portal.NoSuchShardException; 166 167 public Shard updateImpl(Shard shard); 168 169 /** 170 * Returns the shard with the primary key or throws a {@link NoSuchShardException} if it could not be found. 171 * 172 * @param shardId the primary key of the shard 173 * @return the shard 174 * @throws NoSuchShardException if a shard with the primary key could not be found 175 */ 176 public Shard findByPrimaryKey(long shardId) 177 throws com.liferay.portal.NoSuchShardException; 178 179 /** 180 * Returns the shard with the primary key or returns <code>null</code> if it could not be found. 181 * 182 * @param shardId the primary key of the shard 183 * @return the shard, or <code>null</code> if a shard with the primary key could not be found 184 */ 185 public Shard fetchByPrimaryKey(long shardId); 186 187 @Override 188 public java.util.Map<java.io.Serializable, Shard> fetchByPrimaryKeys( 189 java.util.Set<java.io.Serializable> primaryKeys); 190 191 /** 192 * Returns all the shards. 193 * 194 * @return the shards 195 */ 196 public java.util.List<Shard> findAll(); 197 198 /** 199 * Returns a range of all the shards. 200 * 201 * <p> 202 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 203 * </p> 204 * 205 * @param start the lower bound of the range of shards 206 * @param end the upper bound of the range of shards (not inclusive) 207 * @return the range of shards 208 */ 209 public java.util.List<Shard> findAll(int start, int end); 210 211 /** 212 * Returns an ordered range of all the shards. 213 * 214 * <p> 215 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 216 * </p> 217 * 218 * @param start the lower bound of the range of shards 219 * @param end the upper bound of the range of shards (not inclusive) 220 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 221 * @return the ordered range of shards 222 */ 223 public java.util.List<Shard> findAll(int start, int end, 224 com.liferay.portal.kernel.util.OrderByComparator<Shard> orderByComparator); 225 226 /** 227 * Removes all the shards from the database. 228 */ 229 public void removeAll(); 230 231 /** 232 * Returns the number of shards. 233 * 234 * @return the number of shards 235 */ 236 public int countAll(); 237 }