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