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.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.model.Ticket; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the ticket service. This utility wraps {@link com.liferay.portal.service.persistence.impl.TicketPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see TicketPersistence 037 * @see com.liferay.portal.service.persistence.impl.TicketPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class TicketUtil { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 046 */ 047 048 /** 049 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 050 */ 051 public static void clearCache() { 052 getPersistence().clearCache(); 053 } 054 055 /** 056 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 057 */ 058 public static void clearCache(Ticket ticket) { 059 getPersistence().clearCache(ticket); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 064 */ 065 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery) { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery, 080 int start, int end) { 081 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 082 } 083 084 /** 085 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 086 */ 087 public static List<Ticket> findWithDynamicQuery(DynamicQuery dynamicQuery, 088 int start, int end, OrderByComparator<Ticket> orderByComparator) { 089 return getPersistence() 090 .findWithDynamicQuery(dynamicQuery, start, end, 091 orderByComparator); 092 } 093 094 /** 095 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 096 */ 097 public static Ticket update(Ticket ticket) { 098 return getPersistence().update(ticket); 099 } 100 101 /** 102 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 103 */ 104 public static Ticket update(Ticket ticket, ServiceContext serviceContext) { 105 return getPersistence().update(ticket, serviceContext); 106 } 107 108 /** 109 * Returns the ticket where key = ? or throws a {@link NoSuchTicketException} if it could not be found. 110 * 111 * @param key the key 112 * @return the matching ticket 113 * @throws NoSuchTicketException if a matching ticket could not be found 114 */ 115 public static Ticket findByKey(java.lang.String key) 116 throws com.liferay.portal.NoSuchTicketException { 117 return getPersistence().findByKey(key); 118 } 119 120 /** 121 * Returns the ticket where key = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 122 * 123 * @param key the key 124 * @return the matching ticket, or <code>null</code> if a matching ticket could not be found 125 */ 126 public static Ticket fetchByKey(java.lang.String key) { 127 return getPersistence().fetchByKey(key); 128 } 129 130 /** 131 * Returns the ticket where key = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 132 * 133 * @param key the key 134 * @param retrieveFromCache whether to use the finder cache 135 * @return the matching ticket, or <code>null</code> if a matching ticket could not be found 136 */ 137 public static Ticket fetchByKey(java.lang.String key, 138 boolean retrieveFromCache) { 139 return getPersistence().fetchByKey(key, retrieveFromCache); 140 } 141 142 /** 143 * Removes the ticket where key = ? from the database. 144 * 145 * @param key the key 146 * @return the ticket that was removed 147 */ 148 public static Ticket removeByKey(java.lang.String key) 149 throws com.liferay.portal.NoSuchTicketException { 150 return getPersistence().removeByKey(key); 151 } 152 153 /** 154 * Returns the number of tickets where key = ?. 155 * 156 * @param key the key 157 * @return the number of matching tickets 158 */ 159 public static int countByKey(java.lang.String key) { 160 return getPersistence().countByKey(key); 161 } 162 163 /** 164 * Returns all the tickets where classNameId = ? and classPK = ? and type = ?. 165 * 166 * @param classNameId the class name ID 167 * @param classPK the class p k 168 * @param type the type 169 * @return the matching tickets 170 */ 171 public static List<Ticket> findByC_C_T(long classNameId, long classPK, 172 int type) { 173 return getPersistence().findByC_C_T(classNameId, classPK, type); 174 } 175 176 /** 177 * Returns a range of all the tickets where classNameId = ? and classPK = ? and type = ?. 178 * 179 * <p> 180 * 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 TicketModelImpl}. 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. 181 * </p> 182 * 183 * @param classNameId the class name ID 184 * @param classPK the class p k 185 * @param type the type 186 * @param start the lower bound of the range of tickets 187 * @param end the upper bound of the range of tickets (not inclusive) 188 * @return the range of matching tickets 189 */ 190 public static List<Ticket> findByC_C_T(long classNameId, long classPK, 191 int type, int start, int end) { 192 return getPersistence() 193 .findByC_C_T(classNameId, classPK, type, start, end); 194 } 195 196 /** 197 * Returns an ordered range of all the tickets where classNameId = ? and classPK = ? and type = ?. 198 * 199 * <p> 200 * 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 TicketModelImpl}. 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. 201 * </p> 202 * 203 * @param classNameId the class name ID 204 * @param classPK the class p k 205 * @param type the type 206 * @param start the lower bound of the range of tickets 207 * @param end the upper bound of the range of tickets (not inclusive) 208 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 209 * @return the ordered range of matching tickets 210 */ 211 public static List<Ticket> findByC_C_T(long classNameId, long classPK, 212 int type, int start, int end, 213 OrderByComparator<Ticket> orderByComparator) { 214 return getPersistence() 215 .findByC_C_T(classNameId, classPK, type, start, end, 216 orderByComparator); 217 } 218 219 /** 220 * Returns the first ticket in the ordered set where classNameId = ? and classPK = ? and type = ?. 221 * 222 * @param classNameId the class name ID 223 * @param classPK the class p k 224 * @param type the type 225 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 226 * @return the first matching ticket 227 * @throws NoSuchTicketException if a matching ticket could not be found 228 */ 229 public static Ticket findByC_C_T_First(long classNameId, long classPK, 230 int type, OrderByComparator<Ticket> orderByComparator) 231 throws com.liferay.portal.NoSuchTicketException { 232 return getPersistence() 233 .findByC_C_T_First(classNameId, classPK, type, 234 orderByComparator); 235 } 236 237 /** 238 * Returns the first ticket in the ordered set where classNameId = ? and classPK = ? and type = ?. 239 * 240 * @param classNameId the class name ID 241 * @param classPK the class p k 242 * @param type the type 243 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 244 * @return the first matching ticket, or <code>null</code> if a matching ticket could not be found 245 */ 246 public static Ticket fetchByC_C_T_First(long classNameId, long classPK, 247 int type, OrderByComparator<Ticket> orderByComparator) { 248 return getPersistence() 249 .fetchByC_C_T_First(classNameId, classPK, type, 250 orderByComparator); 251 } 252 253 /** 254 * Returns the last ticket in the ordered set where classNameId = ? and classPK = ? and type = ?. 255 * 256 * @param classNameId the class name ID 257 * @param classPK the class p k 258 * @param type the type 259 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 260 * @return the last matching ticket 261 * @throws NoSuchTicketException if a matching ticket could not be found 262 */ 263 public static Ticket findByC_C_T_Last(long classNameId, long classPK, 264 int type, OrderByComparator<Ticket> orderByComparator) 265 throws com.liferay.portal.NoSuchTicketException { 266 return getPersistence() 267 .findByC_C_T_Last(classNameId, classPK, type, 268 orderByComparator); 269 } 270 271 /** 272 * Returns the last ticket in the ordered set where classNameId = ? and classPK = ? and type = ?. 273 * 274 * @param classNameId the class name ID 275 * @param classPK the class p k 276 * @param type the type 277 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 278 * @return the last matching ticket, or <code>null</code> if a matching ticket could not be found 279 */ 280 public static Ticket fetchByC_C_T_Last(long classNameId, long classPK, 281 int type, OrderByComparator<Ticket> orderByComparator) { 282 return getPersistence() 283 .fetchByC_C_T_Last(classNameId, classPK, type, 284 orderByComparator); 285 } 286 287 /** 288 * Returns the tickets before and after the current ticket in the ordered set where classNameId = ? and classPK = ? and type = ?. 289 * 290 * @param ticketId the primary key of the current ticket 291 * @param classNameId the class name ID 292 * @param classPK the class p k 293 * @param type the type 294 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 295 * @return the previous, current, and next ticket 296 * @throws NoSuchTicketException if a ticket with the primary key could not be found 297 */ 298 public static Ticket[] findByC_C_T_PrevAndNext(long ticketId, 299 long classNameId, long classPK, int type, 300 OrderByComparator<Ticket> orderByComparator) 301 throws com.liferay.portal.NoSuchTicketException { 302 return getPersistence() 303 .findByC_C_T_PrevAndNext(ticketId, classNameId, classPK, 304 type, orderByComparator); 305 } 306 307 /** 308 * Removes all the tickets where classNameId = ? and classPK = ? and type = ? from the database. 309 * 310 * @param classNameId the class name ID 311 * @param classPK the class p k 312 * @param type the type 313 */ 314 public static void removeByC_C_T(long classNameId, long classPK, int type) { 315 getPersistence().removeByC_C_T(classNameId, classPK, type); 316 } 317 318 /** 319 * Returns the number of tickets where classNameId = ? and classPK = ? and type = ?. 320 * 321 * @param classNameId the class name ID 322 * @param classPK the class p k 323 * @param type the type 324 * @return the number of matching tickets 325 */ 326 public static int countByC_C_T(long classNameId, long classPK, int type) { 327 return getPersistence().countByC_C_T(classNameId, classPK, type); 328 } 329 330 /** 331 * Caches the ticket in the entity cache if it is enabled. 332 * 333 * @param ticket the ticket 334 */ 335 public static void cacheResult(Ticket ticket) { 336 getPersistence().cacheResult(ticket); 337 } 338 339 /** 340 * Caches the tickets in the entity cache if it is enabled. 341 * 342 * @param tickets the tickets 343 */ 344 public static void cacheResult(List<Ticket> tickets) { 345 getPersistence().cacheResult(tickets); 346 } 347 348 /** 349 * Creates a new ticket with the primary key. Does not add the ticket to the database. 350 * 351 * @param ticketId the primary key for the new ticket 352 * @return the new ticket 353 */ 354 public static Ticket create(long ticketId) { 355 return getPersistence().create(ticketId); 356 } 357 358 /** 359 * Removes the ticket with the primary key from the database. Also notifies the appropriate model listeners. 360 * 361 * @param ticketId the primary key of the ticket 362 * @return the ticket that was removed 363 * @throws NoSuchTicketException if a ticket with the primary key could not be found 364 */ 365 public static Ticket remove(long ticketId) 366 throws com.liferay.portal.NoSuchTicketException { 367 return getPersistence().remove(ticketId); 368 } 369 370 public static Ticket updateImpl(Ticket ticket) { 371 return getPersistence().updateImpl(ticket); 372 } 373 374 /** 375 * Returns the ticket with the primary key or throws a {@link NoSuchTicketException} if it could not be found. 376 * 377 * @param ticketId the primary key of the ticket 378 * @return the ticket 379 * @throws NoSuchTicketException if a ticket with the primary key could not be found 380 */ 381 public static Ticket findByPrimaryKey(long ticketId) 382 throws com.liferay.portal.NoSuchTicketException { 383 return getPersistence().findByPrimaryKey(ticketId); 384 } 385 386 /** 387 * Returns the ticket with the primary key or returns <code>null</code> if it could not be found. 388 * 389 * @param ticketId the primary key of the ticket 390 * @return the ticket, or <code>null</code> if a ticket with the primary key could not be found 391 */ 392 public static Ticket fetchByPrimaryKey(long ticketId) { 393 return getPersistence().fetchByPrimaryKey(ticketId); 394 } 395 396 public static java.util.Map<java.io.Serializable, Ticket> fetchByPrimaryKeys( 397 java.util.Set<java.io.Serializable> primaryKeys) { 398 return getPersistence().fetchByPrimaryKeys(primaryKeys); 399 } 400 401 /** 402 * Returns all the tickets. 403 * 404 * @return the tickets 405 */ 406 public static List<Ticket> findAll() { 407 return getPersistence().findAll(); 408 } 409 410 /** 411 * Returns a range of all the tickets. 412 * 413 * <p> 414 * 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 TicketModelImpl}. 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. 415 * </p> 416 * 417 * @param start the lower bound of the range of tickets 418 * @param end the upper bound of the range of tickets (not inclusive) 419 * @return the range of tickets 420 */ 421 public static List<Ticket> findAll(int start, int end) { 422 return getPersistence().findAll(start, end); 423 } 424 425 /** 426 * Returns an ordered range of all the tickets. 427 * 428 * <p> 429 * 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 TicketModelImpl}. 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. 430 * </p> 431 * 432 * @param start the lower bound of the range of tickets 433 * @param end the upper bound of the range of tickets (not inclusive) 434 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 435 * @return the ordered range of tickets 436 */ 437 public static List<Ticket> findAll(int start, int end, 438 OrderByComparator<Ticket> orderByComparator) { 439 return getPersistence().findAll(start, end, orderByComparator); 440 } 441 442 /** 443 * Removes all the tickets from the database. 444 */ 445 public static void removeAll() { 446 getPersistence().removeAll(); 447 } 448 449 /** 450 * Returns the number of tickets. 451 * 452 * @return the number of tickets 453 */ 454 public static int countAll() { 455 return getPersistence().countAll(); 456 } 457 458 public static TicketPersistence getPersistence() { 459 if (_persistence == null) { 460 _persistence = (TicketPersistence)PortalBeanLocatorUtil.locate(TicketPersistence.class.getName()); 461 462 ReferenceRegistry.registerReference(TicketUtil.class, "_persistence"); 463 } 464 465 return _persistence; 466 } 467 468 /** 469 * @deprecated As of 6.2.0 470 */ 471 @Deprecated 472 public void setPersistence(TicketPersistence persistence) { 473 } 474 475 private static TicketPersistence _persistence; 476 }