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