001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import com.liferay.portal.kernel.exception.SystemException; 018 import com.liferay.portal.model.Portlet; 019 020 /** 021 * The persistence interface for the portlet service. 022 * 023 * <p> 024 * Caching information and settings can be found in <code>portal.properties</code> 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see PortletPersistenceImpl 029 * @see PortletUtil 030 * @generated 031 */ 032 public interface PortletPersistence extends BasePersistence<Portlet> { 033 /* 034 * NOTE FOR DEVELOPERS: 035 * 036 * 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. 037 */ 038 039 /** 040 * Caches the portlet in the entity cache if it is enabled. 041 * 042 * @param portlet the portlet to cache 043 */ 044 public void cacheResult(com.liferay.portal.model.Portlet portlet); 045 046 /** 047 * Caches the portlets in the entity cache if it is enabled. 048 * 049 * @param portlets the portlets to cache 050 */ 051 public void cacheResult( 052 java.util.List<com.liferay.portal.model.Portlet> portlets); 053 054 /** 055 * Creates a new portlet with the primary key. Does not add the portlet to the database. 056 * 057 * @param id the primary key for the new portlet 058 * @return the new portlet 059 */ 060 public com.liferay.portal.model.Portlet create(long id); 061 062 /** 063 * Removes the portlet with the primary key from the database. Also notifies the appropriate model listeners. 064 * 065 * @param id the primary key of the portlet to remove 066 * @return the portlet that was removed 067 * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found 068 * @throws SystemException if a system exception occurred 069 */ 070 public com.liferay.portal.model.Portlet remove(long id) 071 throws com.liferay.portal.NoSuchPortletException, 072 com.liferay.portal.kernel.exception.SystemException; 073 074 public com.liferay.portal.model.Portlet updateImpl( 075 com.liferay.portal.model.Portlet portlet, boolean merge) 076 throws com.liferay.portal.kernel.exception.SystemException; 077 078 /** 079 * Finds the portlet with the primary key or throws a {@link com.liferay.portal.NoSuchPortletException} if it could not be found. 080 * 081 * @param id the primary key of the portlet to find 082 * @return the portlet 083 * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found 084 * @throws SystemException if a system exception occurred 085 */ 086 public com.liferay.portal.model.Portlet findByPrimaryKey(long id) 087 throws com.liferay.portal.NoSuchPortletException, 088 com.liferay.portal.kernel.exception.SystemException; 089 090 /** 091 * Finds the portlet with the primary key or returns <code>null</code> if it could not be found. 092 * 093 * @param id the primary key of the portlet to find 094 * @return the portlet, or <code>null</code> if a portlet with the primary key could not be found 095 * @throws SystemException if a system exception occurred 096 */ 097 public com.liferay.portal.model.Portlet fetchByPrimaryKey(long id) 098 throws com.liferay.portal.kernel.exception.SystemException; 099 100 /** 101 * Finds all the portlets where companyId = ?. 102 * 103 * @param companyId the company ID to search with 104 * @return the matching portlets 105 * @throws SystemException if a system exception occurred 106 */ 107 public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId( 108 long companyId) 109 throws com.liferay.portal.kernel.exception.SystemException; 110 111 /** 112 * Finds a range of all the portlets where companyId = ?. 113 * 114 * <p> 115 * 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. 116 * </p> 117 * 118 * @param companyId the company ID to search with 119 * @param start the lower bound of the range of portlets to return 120 * @param end the upper bound of the range of portlets to return (not inclusive) 121 * @return the range of matching portlets 122 * @throws SystemException if a system exception occurred 123 */ 124 public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId( 125 long companyId, int start, int end) 126 throws com.liferay.portal.kernel.exception.SystemException; 127 128 /** 129 * Finds an ordered range of all the portlets where companyId = ?. 130 * 131 * <p> 132 * 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. 133 * </p> 134 * 135 * @param companyId the company ID to search with 136 * @param start the lower bound of the range of portlets to return 137 * @param end the upper bound of the range of portlets to return (not inclusive) 138 * @param orderByComparator the comparator to order the results by 139 * @return the ordered range of matching portlets 140 * @throws SystemException if a system exception occurred 141 */ 142 public java.util.List<com.liferay.portal.model.Portlet> findByCompanyId( 143 long companyId, int start, int end, 144 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 145 throws com.liferay.portal.kernel.exception.SystemException; 146 147 /** 148 * Finds the first portlet in the ordered set where companyId = ?. 149 * 150 * <p> 151 * 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. 152 * </p> 153 * 154 * @param companyId the company ID to search with 155 * @param orderByComparator the comparator to order the set by 156 * @return the first matching portlet 157 * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found 158 * @throws SystemException if a system exception occurred 159 */ 160 public com.liferay.portal.model.Portlet findByCompanyId_First( 161 long companyId, 162 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 163 throws com.liferay.portal.NoSuchPortletException, 164 com.liferay.portal.kernel.exception.SystemException; 165 166 /** 167 * Finds the last portlet in the ordered set where companyId = ?. 168 * 169 * <p> 170 * 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. 171 * </p> 172 * 173 * @param companyId the company ID to search with 174 * @param orderByComparator the comparator to order the set by 175 * @return the last matching portlet 176 * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found 177 * @throws SystemException if a system exception occurred 178 */ 179 public com.liferay.portal.model.Portlet findByCompanyId_Last( 180 long companyId, 181 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 182 throws com.liferay.portal.NoSuchPortletException, 183 com.liferay.portal.kernel.exception.SystemException; 184 185 /** 186 * Finds the portlets before and after the current portlet in the ordered set where companyId = ?. 187 * 188 * <p> 189 * 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. 190 * </p> 191 * 192 * @param id the primary key of the current portlet 193 * @param companyId the company ID to search with 194 * @param orderByComparator the comparator to order the set by 195 * @return the previous, current, and next portlet 196 * @throws com.liferay.portal.NoSuchPortletException if a portlet with the primary key could not be found 197 * @throws SystemException if a system exception occurred 198 */ 199 public com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext( 200 long id, long companyId, 201 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 202 throws com.liferay.portal.NoSuchPortletException, 203 com.liferay.portal.kernel.exception.SystemException; 204 205 /** 206 * Finds the portlet where companyId = ? and portletId = ? or throws a {@link com.liferay.portal.NoSuchPortletException} if it could not be found. 207 * 208 * @param companyId the company ID to search with 209 * @param portletId the portlet ID to search with 210 * @return the matching portlet 211 * @throws com.liferay.portal.NoSuchPortletException if a matching portlet could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public com.liferay.portal.model.Portlet findByC_P(long companyId, 215 java.lang.String portletId) 216 throws com.liferay.portal.NoSuchPortletException, 217 com.liferay.portal.kernel.exception.SystemException; 218 219 /** 220 * Finds the portlet where companyId = ? and portletId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 221 * 222 * @param companyId the company ID to search with 223 * @param portletId the portlet ID to search with 224 * @return the matching portlet, or <code>null</code> if a matching portlet could not be found 225 * @throws SystemException if a system exception occurred 226 */ 227 public com.liferay.portal.model.Portlet fetchByC_P(long companyId, 228 java.lang.String portletId) 229 throws com.liferay.portal.kernel.exception.SystemException; 230 231 /** 232 * Finds the portlet where companyId = ? and portletId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 233 * 234 * @param companyId the company ID to search with 235 * @param portletId the portlet ID to search with 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 * Finds 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 * Finds 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 to return 260 * @param end the upper bound of the range of portlets to return (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 * Finds 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 to return 275 * @param end the upper bound of the range of portlets to return (not inclusive) 276 * @param orderByComparator the comparator to order the results by 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 to search with 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 to search with 298 * @param portletId the portlet ID to search with 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 * Counts all the portlets where companyId = ?. 315 * 316 * @param companyId the company ID to search with 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 * Counts all the portlets where companyId = ? and portletId = ?. 325 * 326 * @param companyId the company ID to search with 327 * @param portletId the portlet ID to search with 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 * Counts all the 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 343 public Portlet remove(Portlet portlet) throws SystemException; 344 }