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="ContactUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class ContactUtil {
030: public static com.liferay.portal.model.Contact create(long contactId) {
031: return getPersistence().create(contactId);
032: }
033:
034: public static com.liferay.portal.model.Contact remove(long contactId)
035: throws com.liferay.portal.SystemException,
036: com.liferay.portal.NoSuchContactException {
037: return getPersistence().remove(contactId);
038: }
039:
040: public static com.liferay.portal.model.Contact remove(
041: com.liferay.portal.model.Contact contact)
042: throws com.liferay.portal.SystemException {
043: return getPersistence().remove(contact);
044: }
045:
046: public static com.liferay.portal.model.Contact update(
047: com.liferay.portal.model.Contact contact)
048: throws com.liferay.portal.SystemException {
049: return getPersistence().update(contact);
050: }
051:
052: public static com.liferay.portal.model.Contact update(
053: com.liferay.portal.model.Contact contact, boolean merge)
054: throws com.liferay.portal.SystemException {
055: return getPersistence().update(contact, merge);
056: }
057:
058: public static com.liferay.portal.model.Contact updateImpl(
059: com.liferay.portal.model.Contact contact, boolean merge)
060: throws com.liferay.portal.SystemException {
061: return getPersistence().updateImpl(contact, merge);
062: }
063:
064: public static com.liferay.portal.model.Contact findByPrimaryKey(
065: long contactId) throws com.liferay.portal.SystemException,
066: com.liferay.portal.NoSuchContactException {
067: return getPersistence().findByPrimaryKey(contactId);
068: }
069:
070: public static com.liferay.portal.model.Contact fetchByPrimaryKey(
071: long contactId) throws com.liferay.portal.SystemException {
072: return getPersistence().fetchByPrimaryKey(contactId);
073: }
074:
075: public static java.util.List findByCompanyId(long companyId)
076: throws com.liferay.portal.SystemException {
077: return getPersistence().findByCompanyId(companyId);
078: }
079:
080: public static java.util.List findByCompanyId(long companyId,
081: int begin, int end)
082: throws com.liferay.portal.SystemException {
083: return getPersistence().findByCompanyId(companyId, begin, end);
084: }
085:
086: public static java.util.List findByCompanyId(long companyId,
087: int begin, int end,
088: com.liferay.portal.kernel.util.OrderByComparator obc)
089: throws com.liferay.portal.SystemException {
090: return getPersistence().findByCompanyId(companyId, begin, end,
091: obc);
092: }
093:
094: public static com.liferay.portal.model.Contact findByCompanyId_First(
095: long companyId,
096: com.liferay.portal.kernel.util.OrderByComparator obc)
097: throws com.liferay.portal.SystemException,
098: com.liferay.portal.NoSuchContactException {
099: return getPersistence().findByCompanyId_First(companyId, obc);
100: }
101:
102: public static com.liferay.portal.model.Contact findByCompanyId_Last(
103: long companyId,
104: com.liferay.portal.kernel.util.OrderByComparator obc)
105: throws com.liferay.portal.SystemException,
106: com.liferay.portal.NoSuchContactException {
107: return getPersistence().findByCompanyId_Last(companyId, obc);
108: }
109:
110: public static com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
111: long contactId, long companyId,
112: com.liferay.portal.kernel.util.OrderByComparator obc)
113: throws com.liferay.portal.SystemException,
114: com.liferay.portal.NoSuchContactException {
115: return getPersistence().findByCompanyId_PrevAndNext(contactId,
116: companyId, obc);
117: }
118:
119: public static java.util.List findWithDynamicQuery(
120: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
121: throws com.liferay.portal.SystemException {
122: return getPersistence().findWithDynamicQuery(queryInitializer);
123: }
124:
125: public static java.util.List findWithDynamicQuery(
126: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
127: int begin, int end)
128: throws com.liferay.portal.SystemException {
129: return getPersistence().findWithDynamicQuery(queryInitializer,
130: begin, end);
131: }
132:
133: public static java.util.List findAll()
134: throws com.liferay.portal.SystemException {
135: return getPersistence().findAll();
136: }
137:
138: public static java.util.List findAll(int begin, int end)
139: throws com.liferay.portal.SystemException {
140: return getPersistence().findAll(begin, end);
141: }
142:
143: public static java.util.List findAll(int begin, int end,
144: com.liferay.portal.kernel.util.OrderByComparator obc)
145: throws com.liferay.portal.SystemException {
146: return getPersistence().findAll(begin, end, obc);
147: }
148:
149: public static void removeByCompanyId(long companyId)
150: throws com.liferay.portal.SystemException {
151: getPersistence().removeByCompanyId(companyId);
152: }
153:
154: public static void removeAll()
155: throws com.liferay.portal.SystemException {
156: getPersistence().removeAll();
157: }
158:
159: public static int countByCompanyId(long companyId)
160: throws com.liferay.portal.SystemException {
161: return getPersistence().countByCompanyId(companyId);
162: }
163:
164: public static int countAll()
165: throws com.liferay.portal.SystemException {
166: return getPersistence().countAll();
167: }
168:
169: public static ContactPersistence getPersistence() {
170: return _getUtil()._persistence;
171: }
172:
173: public void setPersistence(ContactPersistence persistence) {
174: _persistence = persistence;
175: }
176:
177: private static ContactUtil _getUtil() {
178: if (_util == null) {
179: _util = (ContactUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
180: .locate(_UTIL);
181: }
182:
183: return _util;
184: }
185:
186: private static final String _UTIL = ContactUtil.class.getName();
187: private static ContactUtil _util;
188: private ContactPersistence _persistence;
189: }
|