/portlets/ams-portlet/docroot/WEB-INF/service/com/liferay/ams/service/persistence/CheckoutUtil.java

https://github.com/kevincho/liferay-plugins · Java · 279 lines · 113 code · 31 blank · 135 comment · 2 complexity · 4703be34f6fbd543891961e73394dadc MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.ams.service.persistence;
  15. import com.liferay.ams.model.Checkout;
  16. import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
  17. import com.liferay.portal.kernel.dao.orm.DynamicQuery;
  18. import com.liferay.portal.kernel.exception.SystemException;
  19. import com.liferay.portal.kernel.util.OrderByComparator;
  20. import com.liferay.portal.kernel.util.ReferenceRegistry;
  21. import com.liferay.portal.service.ServiceContext;
  22. import java.util.List;
  23. /**
  24. * The persistence utility for the checkout service. This utility wraps {@link CheckoutPersistenceImpl} 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.
  25. *
  26. * <p>
  27. * Caching information and settings can be found in <code>portal.properties</code>
  28. * </p>
  29. *
  30. * @author Brian Wing Shun Chan
  31. * @see CheckoutPersistence
  32. * @see CheckoutPersistenceImpl
  33. * @generated
  34. */
  35. public class CheckoutUtil {
  36. /*
  37. * NOTE FOR DEVELOPERS:
  38. *
  39. * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
  40. */
  41. /**
  42. * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
  43. */
  44. public static void clearCache() {
  45. getPersistence().clearCache();
  46. }
  47. /**
  48. * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
  49. */
  50. public static void clearCache(Checkout checkout) {
  51. getPersistence().clearCache(checkout);
  52. }
  53. /**
  54. * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
  55. */
  56. public long countWithDynamicQuery(DynamicQuery dynamicQuery)
  57. throws SystemException {
  58. return getPersistence().countWithDynamicQuery(dynamicQuery);
  59. }
  60. /**
  61. * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
  62. */
  63. public static List<Checkout> findWithDynamicQuery(DynamicQuery dynamicQuery)
  64. throws SystemException {
  65. return getPersistence().findWithDynamicQuery(dynamicQuery);
  66. }
  67. /**
  68. * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
  69. */
  70. public static List<Checkout> findWithDynamicQuery(
  71. DynamicQuery dynamicQuery, int start, int end)
  72. throws SystemException {
  73. return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
  74. }
  75. /**
  76. * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
  77. */
  78. public static List<Checkout> findWithDynamicQuery(
  79. DynamicQuery dynamicQuery, int start, int end,
  80. OrderByComparator orderByComparator) throws SystemException {
  81. return getPersistence()
  82. .findWithDynamicQuery(dynamicQuery, start, end,
  83. orderByComparator);
  84. }
  85. /**
  86. * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
  87. */
  88. public static Checkout update(Checkout checkout, boolean merge)
  89. throws SystemException {
  90. return getPersistence().update(checkout, merge);
  91. }
  92. /**
  93. * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
  94. */
  95. public static Checkout update(Checkout checkout, boolean merge,
  96. ServiceContext serviceContext) throws SystemException {
  97. return getPersistence().update(checkout, merge, serviceContext);
  98. }
  99. /**
  100. * Caches the checkout in the entity cache if it is enabled.
  101. *
  102. * @param checkout the checkout
  103. */
  104. public static void cacheResult(com.liferay.ams.model.Checkout checkout) {
  105. getPersistence().cacheResult(checkout);
  106. }
  107. /**
  108. * Caches the checkouts in the entity cache if it is enabled.
  109. *
  110. * @param checkouts the checkouts
  111. */
  112. public static void cacheResult(
  113. java.util.List<com.liferay.ams.model.Checkout> checkouts) {
  114. getPersistence().cacheResult(checkouts);
  115. }
  116. /**
  117. * Creates a new checkout with the primary key. Does not add the checkout to the database.
  118. *
  119. * @param checkoutId the primary key for the new checkout
  120. * @return the new checkout
  121. */
  122. public static com.liferay.ams.model.Checkout create(long checkoutId) {
  123. return getPersistence().create(checkoutId);
  124. }
  125. /**
  126. * Removes the checkout with the primary key from the database. Also notifies the appropriate model listeners.
  127. *
  128. * @param checkoutId the primary key of the checkout
  129. * @return the checkout that was removed
  130. * @throws com.liferay.ams.NoSuchCheckoutException if a checkout with the primary key could not be found
  131. * @throws SystemException if a system exception occurred
  132. */
  133. public static com.liferay.ams.model.Checkout remove(long checkoutId)
  134. throws com.liferay.ams.NoSuchCheckoutException,
  135. com.liferay.portal.kernel.exception.SystemException {
  136. return getPersistence().remove(checkoutId);
  137. }
  138. public static com.liferay.ams.model.Checkout updateImpl(
  139. com.liferay.ams.model.Checkout checkout, boolean merge)
  140. throws com.liferay.portal.kernel.exception.SystemException {
  141. return getPersistence().updateImpl(checkout, merge);
  142. }
  143. /**
  144. * Returns the checkout with the primary key or throws a {@link com.liferay.ams.NoSuchCheckoutException} if it could not be found.
  145. *
  146. * @param checkoutId the primary key of the checkout
  147. * @return the checkout
  148. * @throws com.liferay.ams.NoSuchCheckoutException if a checkout with the primary key could not be found
  149. * @throws SystemException if a system exception occurred
  150. */
  151. public static com.liferay.ams.model.Checkout findByPrimaryKey(
  152. long checkoutId)
  153. throws com.liferay.ams.NoSuchCheckoutException,
  154. com.liferay.portal.kernel.exception.SystemException {
  155. return getPersistence().findByPrimaryKey(checkoutId);
  156. }
  157. /**
  158. * Returns the checkout with the primary key or returns <code>null</code> if it could not be found.
  159. *
  160. * @param checkoutId the primary key of the checkout
  161. * @return the checkout, or <code>null</code> if a checkout with the primary key could not be found
  162. * @throws SystemException if a system exception occurred
  163. */
  164. public static com.liferay.ams.model.Checkout fetchByPrimaryKey(
  165. long checkoutId)
  166. throws com.liferay.portal.kernel.exception.SystemException {
  167. return getPersistence().fetchByPrimaryKey(checkoutId);
  168. }
  169. /**
  170. * Returns all the checkouts.
  171. *
  172. * @return the checkouts
  173. * @throws SystemException if a system exception occurred
  174. */
  175. public static java.util.List<com.liferay.ams.model.Checkout> findAll()
  176. throws com.liferay.portal.kernel.exception.SystemException {
  177. return getPersistence().findAll();
  178. }
  179. /**
  180. * Returns a range of all the checkouts.
  181. *
  182. * <p>
  183. * 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.
  184. * </p>
  185. *
  186. * @param start the lower bound of the range of checkouts
  187. * @param end the upper bound of the range of checkouts (not inclusive)
  188. * @return the range of checkouts
  189. * @throws SystemException if a system exception occurred
  190. */
  191. public static java.util.List<com.liferay.ams.model.Checkout> findAll(
  192. int start, int end)
  193. throws com.liferay.portal.kernel.exception.SystemException {
  194. return getPersistence().findAll(start, end);
  195. }
  196. /**
  197. * Returns an ordered range of all the checkouts.
  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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
  201. * </p>
  202. *
  203. * @param start the lower bound of the range of checkouts
  204. * @param end the upper bound of the range of checkouts (not inclusive)
  205. * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
  206. * @return the ordered range of checkouts
  207. * @throws SystemException if a system exception occurred
  208. */
  209. public static java.util.List<com.liferay.ams.model.Checkout> findAll(
  210. int start, int end,
  211. com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
  212. throws com.liferay.portal.kernel.exception.SystemException {
  213. return getPersistence().findAll(start, end, orderByComparator);
  214. }
  215. /**
  216. * Removes all the checkouts from the database.
  217. *
  218. * @throws SystemException if a system exception occurred
  219. */
  220. public static void removeAll()
  221. throws com.liferay.portal.kernel.exception.SystemException {
  222. getPersistence().removeAll();
  223. }
  224. /**
  225. * Returns the number of checkouts.
  226. *
  227. * @return the number of checkouts
  228. * @throws SystemException if a system exception occurred
  229. */
  230. public static int countAll()
  231. throws com.liferay.portal.kernel.exception.SystemException {
  232. return getPersistence().countAll();
  233. }
  234. public static CheckoutPersistence getPersistence() {
  235. if (_persistence == null) {
  236. _persistence = (CheckoutPersistence)PortletBeanLocatorUtil.locate(com.liferay.ams.service.ClpSerializer.getServletContextName(),
  237. CheckoutPersistence.class.getName());
  238. ReferenceRegistry.registerReference(CheckoutUtil.class,
  239. "_persistence");
  240. }
  241. return _persistence;
  242. }
  243. public void setPersistence(CheckoutPersistence persistence) {
  244. _persistence = persistence;
  245. ReferenceRegistry.registerReference(CheckoutUtil.class, "_persistence");
  246. }
  247. private static CheckoutPersistence _persistence;
  248. }