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