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