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.Portlet; 020 021 /** 022 * The persistence interface for the portlet 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.PortletPersistenceImpl 030 * @see PortletUtil 031 * @generated 032 */ 033 @ProviderType 034 public interface PortletPersistence extends BasePersistence<Portlet> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link PortletUtil} to access the portlet persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Returns all the portlets where companyId = ?. 043 * 044 * @param companyId the company ID 045 * @return the matching portlets 046 */ 047 public java.util.List<Portlet> findByCompanyId(long companyId); 048 049 /** 050 * Returns a range of all the portlets where companyId = ?. 051 * 052 * <p> 053 * 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 PortletModelImpl}. 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. 054 * </p> 055 * 056 * @param companyId the company ID 057 * @param start the lower bound of the range of portlets 058 * @param end the upper bound of the range of portlets (not inclusive) 059 * @return the range of matching portlets 060 */ 061 public java.util.List<Portlet> findByCompanyId(long companyId, int start, 062 int end); 063 064 /** 065 * Returns an ordered range of all the portlets where companyId = ?. 066 * 067 * <p> 068 * 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 PortletModelImpl}. 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. 069 * </p> 070 * 071 * @param companyId the company ID 072 * @param start the lower bound of the range of portlets 073 * @param end the upper bound of the range of portlets (not inclusive) 074 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 075 * @return the ordered range of matching portlets 076 */ 077 public java.util.List<Portlet> findByCompanyId(long companyId, int start, 078 int end, 079 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator); 080 081 /** 082 * Returns an ordered range of all the portlets where companyId = ?. 083 * 084 * <p> 085 * 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 PortletModelImpl}. 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. 086 * </p> 087 * 088 * @param companyId the company ID 089 * @param start the lower bound of the range of portlets 090 * @param end the upper bound of the range of portlets (not inclusive) 091 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 092 * @param retrieveFromCache whether to retrieve from the finder cache 093 * @return the ordered range of matching portlets 094 */ 095 public java.util.List<Portlet> findByCompanyId(long companyId, int start, 096 int end, 097 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator, 098 boolean retrieveFromCache); 099 100 /** 101 * Returns the first portlet in the ordered set where companyId = ?. 102 * 103 * @param companyId the company ID 104 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 105 * @return the first matching portlet 106 * @throws NoSuchPortletException if a matching portlet could not be found 107 */ 108 public Portlet findByCompanyId_First(long companyId, 109 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator) 110 throws com.liferay.portal.exception.NoSuchPortletException; 111 112 /** 113 * Returns the first portlet in the ordered set where companyId = ?. 114 * 115 * @param companyId the company ID 116 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 117 * @return the first matching portlet, or <code>null</code> if a matching portlet could not be found 118 */ 119 public Portlet fetchByCompanyId_First(long companyId, 120 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator); 121 122 /** 123 * Returns the last portlet in the ordered set where companyId = ?. 124 * 125 * @param companyId the company ID 126 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 127 * @return the last matching portlet 128 * @throws NoSuchPortletException if a matching portlet could not be found 129 */ 130 public Portlet findByCompanyId_Last(long companyId, 131 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator) 132 throws com.liferay.portal.exception.NoSuchPortletException; 133 134 /** 135 * Returns the last portlet in the ordered set where companyId = ?. 136 * 137 * @param companyId the company ID 138 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 139 * @return the last matching portlet, or <code>null</code> if a matching portlet could not be found 140 */ 141 public Portlet fetchByCompanyId_Last(long companyId, 142 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator); 143 144 /** 145 * Returns the portlets before and after the current portlet in the ordered set where companyId = ?. 146 * 147 * @param id the primary key of the current portlet 148 * @param companyId the company ID 149 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 150 * @return the previous, current, and next portlet 151 * @throws NoSuchPortletException if a portlet with the primary key could not be found 152 */ 153 public Portlet[] findByCompanyId_PrevAndNext(long id, long companyId, 154 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator) 155 throws com.liferay.portal.exception.NoSuchPortletException; 156 157 /** 158 * Removes all the portlets where companyId = ? from the database. 159 * 160 * @param companyId the company ID 161 */ 162 public void removeByCompanyId(long companyId); 163 164 /** 165 * Returns the number of portlets where companyId = ?. 166 * 167 * @param companyId the company ID 168 * @return the number of matching portlets 169 */ 170 public int countByCompanyId(long companyId); 171 172 /** 173 * Returns the portlet where companyId = ? and portletId = ? or throws a {@link NoSuchPortletException} if it could not be found. 174 * 175 * @param companyId the company ID 176 * @param portletId the portlet ID 177 * @return the matching portlet 178 * @throws NoSuchPortletException if a matching portlet could not be found 179 */ 180 public Portlet findByC_P(long companyId, java.lang.String portletId) 181 throws com.liferay.portal.exception.NoSuchPortletException; 182 183 /** 184 * Returns the portlet where companyId = ? and portletId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 185 * 186 * @param companyId the company ID 187 * @param portletId the portlet ID 188 * @return the matching portlet, or <code>null</code> if a matching portlet could not be found 189 */ 190 public Portlet fetchByC_P(long companyId, java.lang.String portletId); 191 192 /** 193 * Returns the portlet where companyId = ? and portletId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 194 * 195 * @param companyId the company ID 196 * @param portletId the portlet ID 197 * @param retrieveFromCache whether to retrieve from the finder cache 198 * @return the matching portlet, or <code>null</code> if a matching portlet could not be found 199 */ 200 public Portlet fetchByC_P(long companyId, java.lang.String portletId, 201 boolean retrieveFromCache); 202 203 /** 204 * Removes the portlet where companyId = ? and portletId = ? from the database. 205 * 206 * @param companyId the company ID 207 * @param portletId the portlet ID 208 * @return the portlet that was removed 209 */ 210 public Portlet removeByC_P(long companyId, java.lang.String portletId) 211 throws com.liferay.portal.exception.NoSuchPortletException; 212 213 /** 214 * Returns the number of portlets where companyId = ? and portletId = ?. 215 * 216 * @param companyId the company ID 217 * @param portletId the portlet ID 218 * @return the number of matching portlets 219 */ 220 public int countByC_P(long companyId, java.lang.String portletId); 221 222 /** 223 * Caches the portlet in the entity cache if it is enabled. 224 * 225 * @param portlet the portlet 226 */ 227 public void cacheResult(Portlet portlet); 228 229 /** 230 * Caches the portlets in the entity cache if it is enabled. 231 * 232 * @param portlets the portlets 233 */ 234 public void cacheResult(java.util.List<Portlet> portlets); 235 236 /** 237 * Creates a new portlet with the primary key. Does not add the portlet to the database. 238 * 239 * @param id the primary key for the new portlet 240 * @return the new portlet 241 */ 242 public Portlet create(long id); 243 244 /** 245 * Removes the portlet with the primary key from the database. Also notifies the appropriate model listeners. 246 * 247 * @param id the primary key of the portlet 248 * @return the portlet that was removed 249 * @throws NoSuchPortletException if a portlet with the primary key could not be found 250 */ 251 public Portlet remove(long id) 252 throws com.liferay.portal.exception.NoSuchPortletException; 253 254 public Portlet updateImpl(Portlet portlet); 255 256 /** 257 * Returns the portlet with the primary key or throws a {@link NoSuchPortletException} if it could not be found. 258 * 259 * @param id the primary key of the portlet 260 * @return the portlet 261 * @throws NoSuchPortletException if a portlet with the primary key could not be found 262 */ 263 public Portlet findByPrimaryKey(long id) 264 throws com.liferay.portal.exception.NoSuchPortletException; 265 266 /** 267 * Returns the portlet with the primary key or returns <code>null</code> if it could not be found. 268 * 269 * @param id the primary key of the portlet 270 * @return the portlet, or <code>null</code> if a portlet with the primary key could not be found 271 */ 272 public Portlet fetchByPrimaryKey(long id); 273 274 @Override 275 public java.util.Map<java.io.Serializable, Portlet> fetchByPrimaryKeys( 276 java.util.Set<java.io.Serializable> primaryKeys); 277 278 /** 279 * Returns all the portlets. 280 * 281 * @return the portlets 282 */ 283 public java.util.List<Portlet> findAll(); 284 285 /** 286 * Returns a range of all the portlets. 287 * 288 * <p> 289 * 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 PortletModelImpl}. 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. 290 * </p> 291 * 292 * @param start the lower bound of the range of portlets 293 * @param end the upper bound of the range of portlets (not inclusive) 294 * @return the range of portlets 295 */ 296 public java.util.List<Portlet> findAll(int start, int end); 297 298 /** 299 * Returns an ordered range of all the portlets. 300 * 301 * <p> 302 * 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 PortletModelImpl}. 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. 303 * </p> 304 * 305 * @param start the lower bound of the range of portlets 306 * @param end the upper bound of the range of portlets (not inclusive) 307 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 308 * @return the ordered range of portlets 309 */ 310 public java.util.List<Portlet> findAll(int start, int end, 311 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator); 312 313 /** 314 * Returns an ordered range of all the portlets. 315 * 316 * <p> 317 * 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 PortletModelImpl}. 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. 318 * </p> 319 * 320 * @param start the lower bound of the range of portlets 321 * @param end the upper bound of the range of portlets (not inclusive) 322 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 323 * @param retrieveFromCache whether to retrieve from the finder cache 324 * @return the ordered range of portlets 325 */ 326 public java.util.List<Portlet> findAll(int start, int end, 327 com.liferay.portal.kernel.util.OrderByComparator<Portlet> orderByComparator, 328 boolean retrieveFromCache); 329 330 /** 331 * Removes all the portlets from the database. 332 */ 333 public void removeAll(); 334 335 /** 336 * Returns the number of portlets. 337 * 338 * @return the number of portlets 339 */ 340 public int countAll(); 341 342 @Override 343 public java.util.Set<java.lang.String> getBadColumnNames(); 344 }