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.ClusterGroup; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * 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. 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 ClusterGroupPersistence 037 * @see ClusterGroupPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class ClusterGroupUtil { 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(ClusterGroup clusterGroup) { 059 getPersistence().clearCache(clusterGroup); 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<ClusterGroup> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<ClusterGroup> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<ClusterGroup> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator<ClusterGroup> orderByComparator) { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 098 */ 099 public static ClusterGroup update(ClusterGroup clusterGroup) { 100 return getPersistence().update(clusterGroup); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 105 */ 106 public static ClusterGroup update(ClusterGroup clusterGroup, 107 ServiceContext serviceContext) { 108 return getPersistence().update(clusterGroup, serviceContext); 109 } 110 111 /** 112 * Caches the cluster group in the entity cache if it is enabled. 113 * 114 * @param clusterGroup the cluster group 115 */ 116 public static void cacheResult( 117 com.liferay.portal.model.ClusterGroup clusterGroup) { 118 getPersistence().cacheResult(clusterGroup); 119 } 120 121 /** 122 * Caches the cluster groups in the entity cache if it is enabled. 123 * 124 * @param clusterGroups the cluster groups 125 */ 126 public static void cacheResult( 127 java.util.List<com.liferay.portal.model.ClusterGroup> clusterGroups) { 128 getPersistence().cacheResult(clusterGroups); 129 } 130 131 /** 132 * Creates a new cluster group with the primary key. Does not add the cluster group to the database. 133 * 134 * @param clusterGroupId the primary key for the new cluster group 135 * @return the new cluster group 136 */ 137 public static com.liferay.portal.model.ClusterGroup create( 138 long clusterGroupId) { 139 return getPersistence().create(clusterGroupId); 140 } 141 142 /** 143 * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners. 144 * 145 * @param clusterGroupId the primary key of the cluster group 146 * @return the cluster group that was removed 147 * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found 148 */ 149 public static com.liferay.portal.model.ClusterGroup remove( 150 long clusterGroupId) 151 throws com.liferay.portal.NoSuchClusterGroupException { 152 return getPersistence().remove(clusterGroupId); 153 } 154 155 public static com.liferay.portal.model.ClusterGroup updateImpl( 156 com.liferay.portal.model.ClusterGroup clusterGroup) { 157 return getPersistence().updateImpl(clusterGroup); 158 } 159 160 /** 161 * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchClusterGroupException} if it could not be found. 162 * 163 * @param clusterGroupId the primary key of the cluster group 164 * @return the cluster group 165 * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found 166 */ 167 public static com.liferay.portal.model.ClusterGroup findByPrimaryKey( 168 long clusterGroupId) 169 throws com.liferay.portal.NoSuchClusterGroupException { 170 return getPersistence().findByPrimaryKey(clusterGroupId); 171 } 172 173 /** 174 * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found. 175 * 176 * @param clusterGroupId the primary key of the cluster group 177 * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found 178 */ 179 public static com.liferay.portal.model.ClusterGroup fetchByPrimaryKey( 180 long clusterGroupId) { 181 return getPersistence().fetchByPrimaryKey(clusterGroupId); 182 } 183 184 public static java.util.Map<java.io.Serializable, com.liferay.portal.model.ClusterGroup> fetchByPrimaryKeys( 185 java.util.Set<java.io.Serializable> primaryKeys) { 186 return getPersistence().fetchByPrimaryKeys(primaryKeys); 187 } 188 189 /** 190 * Returns all the cluster groups. 191 * 192 * @return the cluster groups 193 */ 194 public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll() { 195 return getPersistence().findAll(); 196 } 197 198 /** 199 * Returns a range of all the cluster groups. 200 * 201 * <p> 202 * 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. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ClusterGroupModelImpl}. 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. 203 * </p> 204 * 205 * @param start the lower bound of the range of cluster groups 206 * @param end the upper bound of the range of cluster groups (not inclusive) 207 * @return the range of cluster groups 208 */ 209 public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll( 210 int start, int end) { 211 return getPersistence().findAll(start, end); 212 } 213 214 /** 215 * Returns an ordered range of all the cluster groups. 216 * 217 * <p> 218 * 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. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ClusterGroupModelImpl}. 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. 219 * </p> 220 * 221 * @param start the lower bound of the range of cluster groups 222 * @param end the upper bound of the range of cluster groups (not inclusive) 223 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 224 * @return the ordered range of cluster groups 225 */ 226 public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll( 227 int start, int end, 228 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.ClusterGroup> orderByComparator) { 229 return getPersistence().findAll(start, end, orderByComparator); 230 } 231 232 /** 233 * Removes all the cluster groups from the database. 234 */ 235 public static void removeAll() { 236 getPersistence().removeAll(); 237 } 238 239 /** 240 * Returns the number of cluster groups. 241 * 242 * @return the number of cluster groups 243 */ 244 public static int countAll() { 245 return getPersistence().countAll(); 246 } 247 248 public static ClusterGroupPersistence getPersistence() { 249 if (_persistence == null) { 250 _persistence = (ClusterGroupPersistence)PortalBeanLocatorUtil.locate(ClusterGroupPersistence.class.getName()); 251 252 ReferenceRegistry.registerReference(ClusterGroupUtil.class, 253 "_persistence"); 254 } 255 256 return _persistence; 257 } 258 259 /** 260 * @deprecated As of 6.2.0 261 */ 262 @Deprecated 263 public void setPersistence(ClusterGroupPersistence persistence) { 264 } 265 266 private static ClusterGroupPersistence _persistence; 267 }