001 /** 002 * Copyright (c) 2000-2010 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.Contact; 018 019 /** 020 * The persistence interface for the contact service. 021 * 022 * <p> 023 * Never modify or reference this interface directly. Always use {@link ContactUtil} to access the contact persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 024 * </p> 025 * 026 * <p> 027 * Caching information and settings can be found in <code>portal.properties</code> 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see ContactPersistenceImpl 032 * @see ContactUtil 033 * @generated 034 */ 035 public interface ContactPersistence extends BasePersistence<Contact> { 036 /** 037 * Caches the contact in the entity cache if it is enabled. 038 * 039 * @param contact the contact to cache 040 */ 041 public void cacheResult(com.liferay.portal.model.Contact contact); 042 043 /** 044 * Caches the contacts in the entity cache if it is enabled. 045 * 046 * @param contacts the contacts to cache 047 */ 048 public void cacheResult( 049 java.util.List<com.liferay.portal.model.Contact> contacts); 050 051 /** 052 * Creates a new contact with the primary key. Does not add the contact to the database. 053 * 054 * @param contactId the primary key for the new contact 055 * @return the new contact 056 */ 057 public com.liferay.portal.model.Contact create(long contactId); 058 059 /** 060 * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners. 061 * 062 * @param contactId the primary key of the contact to remove 063 * @return the contact that was removed 064 * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found 065 * @throws SystemException if a system exception occurred 066 */ 067 public com.liferay.portal.model.Contact remove(long contactId) 068 throws com.liferay.portal.NoSuchContactException, 069 com.liferay.portal.kernel.exception.SystemException; 070 071 public com.liferay.portal.model.Contact updateImpl( 072 com.liferay.portal.model.Contact contact, boolean merge) 073 throws com.liferay.portal.kernel.exception.SystemException; 074 075 /** 076 * Finds the contact with the primary key or throws a {@link com.liferay.portal.NoSuchContactException} if it could not be found. 077 * 078 * @param contactId the primary key of the contact to find 079 * @return the contact 080 * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found 081 * @throws SystemException if a system exception occurred 082 */ 083 public com.liferay.portal.model.Contact findByPrimaryKey(long contactId) 084 throws com.liferay.portal.NoSuchContactException, 085 com.liferay.portal.kernel.exception.SystemException; 086 087 /** 088 * Finds the contact with the primary key or returns <code>null</code> if it could not be found. 089 * 090 * @param contactId the primary key of the contact to find 091 * @return the contact, or <code>null</code> if a contact with the primary key could not be found 092 * @throws SystemException if a system exception occurred 093 */ 094 public com.liferay.portal.model.Contact fetchByPrimaryKey(long contactId) 095 throws com.liferay.portal.kernel.exception.SystemException; 096 097 /** 098 * Finds all the contacts where companyId = ?. 099 * 100 * @param companyId the company id to search with 101 * @return the matching contacts 102 * @throws SystemException if a system exception occurred 103 */ 104 public java.util.List<com.liferay.portal.model.Contact> findByCompanyId( 105 long companyId) 106 throws com.liferay.portal.kernel.exception.SystemException; 107 108 /** 109 * Finds a range of all the contacts where companyId = ?. 110 * 111 * <p> 112 * 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. 113 * </p> 114 * 115 * @param companyId the company id to search with 116 * @param start the lower bound of the range of contacts to return 117 * @param end the upper bound of the range of contacts to return (not inclusive) 118 * @return the range of matching contacts 119 * @throws SystemException if a system exception occurred 120 */ 121 public java.util.List<com.liferay.portal.model.Contact> findByCompanyId( 122 long companyId, int start, int end) 123 throws com.liferay.portal.kernel.exception.SystemException; 124 125 /** 126 * Finds an ordered range of all the contacts where companyId = ?. 127 * 128 * <p> 129 * 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. 130 * </p> 131 * 132 * @param companyId the company id to search with 133 * @param start the lower bound of the range of contacts to return 134 * @param end the upper bound of the range of contacts to return (not inclusive) 135 * @param orderByComparator the comparator to order the results by 136 * @return the ordered range of matching contacts 137 * @throws SystemException if a system exception occurred 138 */ 139 public java.util.List<com.liferay.portal.model.Contact> findByCompanyId( 140 long companyId, int start, int end, 141 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 142 throws com.liferay.portal.kernel.exception.SystemException; 143 144 /** 145 * Finds the first contact in the ordered set where companyId = ?. 146 * 147 * <p> 148 * 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. 149 * </p> 150 * 151 * @param companyId the company id to search with 152 * @param orderByComparator the comparator to order the set by 153 * @return the first matching contact 154 * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found 155 * @throws SystemException if a system exception occurred 156 */ 157 public com.liferay.portal.model.Contact findByCompanyId_First( 158 long companyId, 159 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 160 throws com.liferay.portal.NoSuchContactException, 161 com.liferay.portal.kernel.exception.SystemException; 162 163 /** 164 * Finds the last contact in the ordered set where companyId = ?. 165 * 166 * <p> 167 * 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. 168 * </p> 169 * 170 * @param companyId the company id to search with 171 * @param orderByComparator the comparator to order the set by 172 * @return the last matching contact 173 * @throws com.liferay.portal.NoSuchContactException if a matching contact could not be found 174 * @throws SystemException if a system exception occurred 175 */ 176 public com.liferay.portal.model.Contact findByCompanyId_Last( 177 long companyId, 178 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 179 throws com.liferay.portal.NoSuchContactException, 180 com.liferay.portal.kernel.exception.SystemException; 181 182 /** 183 * Finds the contacts before and after the current contact in the ordered set where companyId = ?. 184 * 185 * <p> 186 * 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. 187 * </p> 188 * 189 * @param contactId the primary key of the current contact 190 * @param companyId the company id to search with 191 * @param orderByComparator the comparator to order the set by 192 * @return the previous, current, and next contact 193 * @throws com.liferay.portal.NoSuchContactException if a contact with the primary key could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext( 197 long contactId, long companyId, 198 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 199 throws com.liferay.portal.NoSuchContactException, 200 com.liferay.portal.kernel.exception.SystemException; 201 202 /** 203 * Finds all the contacts. 204 * 205 * @return the contacts 206 * @throws SystemException if a system exception occurred 207 */ 208 public java.util.List<com.liferay.portal.model.Contact> findAll() 209 throws com.liferay.portal.kernel.exception.SystemException; 210 211 /** 212 * Finds a range of all the contacts. 213 * 214 * <p> 215 * 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. 216 * </p> 217 * 218 * @param start the lower bound of the range of contacts to return 219 * @param end the upper bound of the range of contacts to return (not inclusive) 220 * @return the range of contacts 221 * @throws SystemException if a system exception occurred 222 */ 223 public java.util.List<com.liferay.portal.model.Contact> findAll(int start, 224 int end) throws com.liferay.portal.kernel.exception.SystemException; 225 226 /** 227 * Finds an ordered range of all the contacts. 228 * 229 * <p> 230 * 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. 231 * </p> 232 * 233 * @param start the lower bound of the range of contacts to return 234 * @param end the upper bound of the range of contacts to return (not inclusive) 235 * @param orderByComparator the comparator to order the results by 236 * @return the ordered range of contacts 237 * @throws SystemException if a system exception occurred 238 */ 239 public java.util.List<com.liferay.portal.model.Contact> findAll(int start, 240 int end, 241 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 242 throws com.liferay.portal.kernel.exception.SystemException; 243 244 /** 245 * Removes all the contacts where companyId = ? from the database. 246 * 247 * @param companyId the company id to search with 248 * @throws SystemException if a system exception occurred 249 */ 250 public void removeByCompanyId(long companyId) 251 throws com.liferay.portal.kernel.exception.SystemException; 252 253 /** 254 * Removes all the contacts from the database. 255 * 256 * @throws SystemException if a system exception occurred 257 */ 258 public void removeAll() 259 throws com.liferay.portal.kernel.exception.SystemException; 260 261 /** 262 * Counts all the contacts where companyId = ?. 263 * 264 * @param companyId the company id to search with 265 * @return the number of matching contacts 266 * @throws SystemException if a system exception occurred 267 */ 268 public int countByCompanyId(long companyId) 269 throws com.liferay.portal.kernel.exception.SystemException; 270 271 /** 272 * Counts all the contacts. 273 * 274 * @return the number of contacts 275 * @throws SystemException if a system exception occurred 276 */ 277 public int countAll() 278 throws com.liferay.portal.kernel.exception.SystemException; 279 }