/** * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.ese.ils.beta.service.persistence; import com.ese.ils.beta.model.Module; import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.OrderByComparator; import com.liferay.portal.kernel.util.ReferenceRegistry; import com.liferay.portal.service.ServiceContext; import java.util.List; /** * The persistence utility for the module service. This utility wraps {@link ModulePersistenceImpl} 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. * * <p> * Caching information and settings can be found in <code>portal.properties</code> * </p> * * @author edik * @see ModulePersistence * @see ModulePersistenceImpl * @generated */ public class ModuleUtil { /* * NOTE FOR DEVELOPERS: * * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. */ /** * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() */ public static void clearCache() { getPersistence().clearCache(); } /** * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) */ public static void clearCache(Module module) { getPersistence().clearCache(module); } /** * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) */ public long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException { return getPersistence().countWithDynamicQuery(dynamicQuery); } /** * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) */ public static List<Module> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException { return getPersistence().findWithDynamicQuery(dynamicQuery); } /** * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) */ public static List<Module> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException { return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); } /** * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) */ public static List<Module> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException { return getPersistence() .findWithDynamicQuery(dynamicQuery, start, end, orderByComparator); } /** * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) */ public static Module update(Module module, boolean merge) throws SystemException { return getPersistence().update(module, merge); } /** * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) */ public static Module update(Module module, boolean merge, ServiceContext serviceContext) throws SystemException { return getPersistence().update(module, merge, serviceContext); } /** * Caches the module in the entity cache if it is enabled. * * @param module the module */ public static void cacheResult(com.ese.ils.beta.model.Module module) { getPersistence().cacheResult(module); } /** * Caches the modules in the entity cache if it is enabled. * * @param modules the modules */ public static void cacheResult( java.util.List<com.ese.ils.beta.model.Module> modules) { getPersistence().cacheResult(modules); } /** * Creates a new module with the primary key. Does not add the module to the database. * * @param moduleId the primary key for the new module * @return the new module */ public static com.ese.ils.beta.model.Module create(long moduleId) { return getPersistence().create(moduleId); } /** * Removes the module with the primary key from the database. Also notifies the appropriate model listeners. * * @param moduleId the primary key of the module * @return the module that was removed * @throws com.ese.ils.beta.NoSuchModuleException if a module with the primary key could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module remove(long moduleId) throws com.ese.ils.beta.NoSuchModuleException, com.liferay.portal.kernel.exception.SystemException { return getPersistence().remove(moduleId); } public static com.ese.ils.beta.model.Module updateImpl( com.ese.ils.beta.model.Module module, boolean merge) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().updateImpl(module, merge); } /** * Returns the module with the primary key or throws a {@link com.ese.ils.beta.NoSuchModuleException} if it could not be found. * * @param moduleId the primary key of the module * @return the module * @throws com.ese.ils.beta.NoSuchModuleException if a module with the primary key could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module findByPrimaryKey(long moduleId) throws com.ese.ils.beta.NoSuchModuleException, com.liferay.portal.kernel.exception.SystemException { return getPersistence().findByPrimaryKey(moduleId); } /** * Returns the module with the primary key or returns <code>null</code> if it could not be found. * * @param moduleId the primary key of the module * @return the module, or <code>null</code> if a module with the primary key could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module fetchByPrimaryKey(long moduleId) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().fetchByPrimaryKey(moduleId); } /** * Returns all the modules where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @return the matching modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findByByLecturer( long lecturerUserId) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findByByLecturer(lecturerUserId); } /** * Returns a range of all the modules where lecturerUserId = ?. * * <p> * 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. * </p> * * @param lecturerUserId the lecturer user ID * @param start the lower bound of the range of modules * @param end the upper bound of the range of modules (not inclusive) * @return the range of matching modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findByByLecturer( long lecturerUserId, int start, int end) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findByByLecturer(lecturerUserId, start, end); } /** * Returns an ordered range of all the modules where lecturerUserId = ?. * * <p> * 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. * </p> * * @param lecturerUserId the lecturer user ID * @param start the lower bound of the range of modules * @param end the upper bound of the range of modules (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of matching modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findByByLecturer( long lecturerUserId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence() .findByByLecturer(lecturerUserId, start, end, orderByComparator); } /** * Returns the first module in the ordered set where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching module * @throws com.ese.ils.beta.NoSuchModuleException if a matching module could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module findByByLecturer_First( long lecturerUserId, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.ese.ils.beta.NoSuchModuleException, com.liferay.portal.kernel.exception.SystemException { return getPersistence() .findByByLecturer_First(lecturerUserId, orderByComparator); } /** * Returns the first module in the ordered set where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the first matching module, or <code>null</code> if a matching module could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module fetchByByLecturer_First( long lecturerUserId, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence() .fetchByByLecturer_First(lecturerUserId, orderByComparator); } /** * Returns the last module in the ordered set where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching module * @throws com.ese.ils.beta.NoSuchModuleException if a matching module could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module findByByLecturer_Last( long lecturerUserId, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.ese.ils.beta.NoSuchModuleException, com.liferay.portal.kernel.exception.SystemException { return getPersistence() .findByByLecturer_Last(lecturerUserId, orderByComparator); } /** * Returns the last module in the ordered set where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching module, or <code>null</code> if a matching module could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module fetchByByLecturer_Last( long lecturerUserId, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence() .fetchByByLecturer_Last(lecturerUserId, orderByComparator); } /** * Returns the modules before and after the current module in the ordered set where lecturerUserId = ?. * * @param moduleId the primary key of the current module * @param lecturerUserId the lecturer user ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the previous, current, and next module * @throws com.ese.ils.beta.NoSuchModuleException if a module with the primary key could not be found * @throws SystemException if a system exception occurred */ public static com.ese.ils.beta.model.Module[] findByByLecturer_PrevAndNext( long moduleId, long lecturerUserId, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.ese.ils.beta.NoSuchModuleException, com.liferay.portal.kernel.exception.SystemException { return getPersistence() .findByByLecturer_PrevAndNext(moduleId, lecturerUserId, orderByComparator); } /** * Returns all the modules. * * @return the modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findAll() throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findAll(); } /** * Returns a range of all the modules. * * <p> * 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. * </p> * * @param start the lower bound of the range of modules * @param end the upper bound of the range of modules (not inclusive) * @return the range of modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findAll( int start, int end) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findAll(start, end); } /** * Returns an ordered range of all the modules. * * <p> * 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. * </p> * * @param start the lower bound of the range of modules * @param end the upper bound of the range of modules (not inclusive) * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) * @return the ordered range of modules * @throws SystemException if a system exception occurred */ public static java.util.List<com.ese.ils.beta.model.Module> findAll( int start, int end, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().findAll(start, end, orderByComparator); } /** * Removes all the modules where lecturerUserId = ? from the database. * * @param lecturerUserId the lecturer user ID * @throws SystemException if a system exception occurred */ public static void removeByByLecturer(long lecturerUserId) throws com.liferay.portal.kernel.exception.SystemException { getPersistence().removeByByLecturer(lecturerUserId); } /** * Removes all the modules from the database. * * @throws SystemException if a system exception occurred */ public static void removeAll() throws com.liferay.portal.kernel.exception.SystemException { getPersistence().removeAll(); } /** * Returns the number of modules where lecturerUserId = ?. * * @param lecturerUserId the lecturer user ID * @return the number of matching modules * @throws SystemException if a system exception occurred */ public static int countByByLecturer(long lecturerUserId) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().countByByLecturer(lecturerUserId); } /** * Returns the number of modules. * * @return the number of modules * @throws SystemException if a system exception occurred */ public static int countAll() throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().countAll(); } public static ModulePersistence getPersistence() { if (_persistence == null) { _persistence = (ModulePersistence)PortletBeanLocatorUtil.locate(com.ese.ils.beta.service.ClpSerializer.getServletContextName(), ModulePersistence.class.getName()); ReferenceRegistry.registerReference(ModuleUtil.class, "_persistence"); } return _persistence; } /** * @deprecated */ public void setPersistence(ModulePersistence persistence) { } private static ModulePersistence _persistence; }