001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="ResourceUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class ResourceUtil {
030: public static com.liferay.portal.model.Resource create(
031: long resourceId) {
032: return getPersistence().create(resourceId);
033: }
034:
035: public static com.liferay.portal.model.Resource remove(
036: long resourceId) throws com.liferay.portal.SystemException,
037: com.liferay.portal.NoSuchResourceException {
038: return getPersistence().remove(resourceId);
039: }
040:
041: public static com.liferay.portal.model.Resource remove(
042: com.liferay.portal.model.Resource resource)
043: throws com.liferay.portal.SystemException {
044: return getPersistence().remove(resource);
045: }
046:
047: public static com.liferay.portal.model.Resource update(
048: com.liferay.portal.model.Resource resource)
049: throws com.liferay.portal.SystemException {
050: return getPersistence().update(resource);
051: }
052:
053: public static com.liferay.portal.model.Resource update(
054: com.liferay.portal.model.Resource resource, boolean merge)
055: throws com.liferay.portal.SystemException {
056: return getPersistence().update(resource, merge);
057: }
058:
059: public static com.liferay.portal.model.Resource updateImpl(
060: com.liferay.portal.model.Resource resource, boolean merge)
061: throws com.liferay.portal.SystemException {
062: return getPersistence().updateImpl(resource, merge);
063: }
064:
065: public static com.liferay.portal.model.Resource findByPrimaryKey(
066: long resourceId) throws com.liferay.portal.SystemException,
067: com.liferay.portal.NoSuchResourceException {
068: return getPersistence().findByPrimaryKey(resourceId);
069: }
070:
071: public static com.liferay.portal.model.Resource fetchByPrimaryKey(
072: long resourceId) throws com.liferay.portal.SystemException {
073: return getPersistence().fetchByPrimaryKey(resourceId);
074: }
075:
076: public static java.util.List findByCodeId(long codeId)
077: throws com.liferay.portal.SystemException {
078: return getPersistence().findByCodeId(codeId);
079: }
080:
081: public static java.util.List findByCodeId(long codeId, int begin,
082: int end) throws com.liferay.portal.SystemException {
083: return getPersistence().findByCodeId(codeId, begin, end);
084: }
085:
086: public static java.util.List findByCodeId(long codeId, int begin,
087: int end,
088: com.liferay.portal.kernel.util.OrderByComparator obc)
089: throws com.liferay.portal.SystemException {
090: return getPersistence().findByCodeId(codeId, begin, end, obc);
091: }
092:
093: public static com.liferay.portal.model.Resource findByCodeId_First(
094: long codeId,
095: com.liferay.portal.kernel.util.OrderByComparator obc)
096: throws com.liferay.portal.SystemException,
097: com.liferay.portal.NoSuchResourceException {
098: return getPersistence().findByCodeId_First(codeId, obc);
099: }
100:
101: public static com.liferay.portal.model.Resource findByCodeId_Last(
102: long codeId,
103: com.liferay.portal.kernel.util.OrderByComparator obc)
104: throws com.liferay.portal.SystemException,
105: com.liferay.portal.NoSuchResourceException {
106: return getPersistence().findByCodeId_Last(codeId, obc);
107: }
108:
109: public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
110: long resourceId, long codeId,
111: com.liferay.portal.kernel.util.OrderByComparator obc)
112: throws com.liferay.portal.SystemException,
113: com.liferay.portal.NoSuchResourceException {
114: return getPersistence().findByCodeId_PrevAndNext(resourceId,
115: codeId, obc);
116: }
117:
118: public static com.liferay.portal.model.Resource findByC_P(
119: long codeId, java.lang.String primKey)
120: throws com.liferay.portal.SystemException,
121: com.liferay.portal.NoSuchResourceException {
122: return getPersistence().findByC_P(codeId, primKey);
123: }
124:
125: public static com.liferay.portal.model.Resource fetchByC_P(
126: long codeId, java.lang.String primKey)
127: throws com.liferay.portal.SystemException {
128: return getPersistence().fetchByC_P(codeId, primKey);
129: }
130:
131: public static java.util.List findWithDynamicQuery(
132: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
133: throws com.liferay.portal.SystemException {
134: return getPersistence().findWithDynamicQuery(queryInitializer);
135: }
136:
137: public static java.util.List findWithDynamicQuery(
138: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
139: int begin, int end)
140: throws com.liferay.portal.SystemException {
141: return getPersistence().findWithDynamicQuery(queryInitializer,
142: begin, end);
143: }
144:
145: public static java.util.List findAll()
146: throws com.liferay.portal.SystemException {
147: return getPersistence().findAll();
148: }
149:
150: public static java.util.List findAll(int begin, int end)
151: throws com.liferay.portal.SystemException {
152: return getPersistence().findAll(begin, end);
153: }
154:
155: public static java.util.List findAll(int begin, int end,
156: com.liferay.portal.kernel.util.OrderByComparator obc)
157: throws com.liferay.portal.SystemException {
158: return getPersistence().findAll(begin, end, obc);
159: }
160:
161: public static void removeByCodeId(long codeId)
162: throws com.liferay.portal.SystemException {
163: getPersistence().removeByCodeId(codeId);
164: }
165:
166: public static void removeByC_P(long codeId, java.lang.String primKey)
167: throws com.liferay.portal.SystemException,
168: com.liferay.portal.NoSuchResourceException {
169: getPersistence().removeByC_P(codeId, primKey);
170: }
171:
172: public static void removeAll()
173: throws com.liferay.portal.SystemException {
174: getPersistence().removeAll();
175: }
176:
177: public static int countByCodeId(long codeId)
178: throws com.liferay.portal.SystemException {
179: return getPersistence().countByCodeId(codeId);
180: }
181:
182: public static int countByC_P(long codeId, java.lang.String primKey)
183: throws com.liferay.portal.SystemException {
184: return getPersistence().countByC_P(codeId, primKey);
185: }
186:
187: public static int countAll()
188: throws com.liferay.portal.SystemException {
189: return getPersistence().countAll();
190: }
191:
192: public static ResourcePersistence getPersistence() {
193: return _getUtil()._persistence;
194: }
195:
196: public void setPersistence(ResourcePersistence persistence) {
197: _persistence = persistence;
198: }
199:
200: private static ResourceUtil _getUtil() {
201: if (_util == null) {
202: _util = (ResourceUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
203: .locate(_UTIL);
204: }
205:
206: return _util;
207: }
208:
209: private static final String _UTIL = ResourceUtil.class.getName();
210: private static ResourceUtil _util;
211: private ResourcePersistence _persistence;
212: }
|