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