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