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.Contact;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * @author    Brian Wing Shun Chan
028     * @see       ContactPersistence
029     * @see       ContactPersistenceImpl
030     * @generated
031     */
032    public class ContactUtil {
033            /**
034             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
035             */
036            public static void clearCache() {
037                    getPersistence().clearCache();
038            }
039    
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
042             */
043            public static void clearCache(Contact contact) {
044                    getPersistence().clearCache(contact);
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
049             */
050            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051                    throws SystemException {
052                    return getPersistence().countWithDynamicQuery(dynamicQuery);
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
057             */
058            public static List<Contact> findWithDynamicQuery(DynamicQuery dynamicQuery)
059                    throws SystemException {
060                    return getPersistence().findWithDynamicQuery(dynamicQuery);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
065             */
066            public static List<Contact> findWithDynamicQuery(
067                    DynamicQuery dynamicQuery, int start, int end)
068                    throws SystemException {
069                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
070            }
071    
072            /**
073             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
074             */
075            public static List<Contact> findWithDynamicQuery(
076                    DynamicQuery dynamicQuery, int start, int end,
077                    OrderByComparator orderByComparator) throws SystemException {
078                    return getPersistence()
079                                       .findWithDynamicQuery(dynamicQuery, start, end,
080                            orderByComparator);
081            }
082    
083            /**
084             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
085             */
086            public static Contact remove(Contact contact) throws SystemException {
087                    return getPersistence().remove(contact);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
092             */
093            public static Contact update(Contact contact, boolean merge)
094                    throws SystemException {
095                    return getPersistence().update(contact, merge);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
100             */
101            public static Contact update(Contact contact, boolean merge,
102                    ServiceContext serviceContext) throws SystemException {
103                    return getPersistence().update(contact, merge, serviceContext);
104            }
105    
106            public static void cacheResult(com.liferay.portal.model.Contact contact) {
107                    getPersistence().cacheResult(contact);
108            }
109    
110            public static void cacheResult(
111                    java.util.List<com.liferay.portal.model.Contact> contacts) {
112                    getPersistence().cacheResult(contacts);
113            }
114    
115            public static com.liferay.portal.model.Contact create(long contactId) {
116                    return getPersistence().create(contactId);
117            }
118    
119            public static com.liferay.portal.model.Contact remove(long contactId)
120                    throws com.liferay.portal.NoSuchContactException,
121                            com.liferay.portal.kernel.exception.SystemException {
122                    return getPersistence().remove(contactId);
123            }
124    
125            public static com.liferay.portal.model.Contact updateImpl(
126                    com.liferay.portal.model.Contact contact, boolean merge)
127                    throws com.liferay.portal.kernel.exception.SystemException {
128                    return getPersistence().updateImpl(contact, merge);
129            }
130    
131            public static com.liferay.portal.model.Contact findByPrimaryKey(
132                    long contactId)
133                    throws com.liferay.portal.NoSuchContactException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    return getPersistence().findByPrimaryKey(contactId);
136            }
137    
138            public static com.liferay.portal.model.Contact fetchByPrimaryKey(
139                    long contactId)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getPersistence().fetchByPrimaryKey(contactId);
142            }
143    
144            public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
145                    long companyId)
146                    throws com.liferay.portal.kernel.exception.SystemException {
147                    return getPersistence().findByCompanyId(companyId);
148            }
149    
150            public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
151                    long companyId, int start, int end)
152                    throws com.liferay.portal.kernel.exception.SystemException {
153                    return getPersistence().findByCompanyId(companyId, start, end);
154            }
155    
156            public static java.util.List<com.liferay.portal.model.Contact> findByCompanyId(
157                    long companyId, int start, int end,
158                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getPersistence()
161                                       .findByCompanyId(companyId, start, end, orderByComparator);
162            }
163    
164            public static com.liferay.portal.model.Contact findByCompanyId_First(
165                    long companyId,
166                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
167                    throws com.liferay.portal.NoSuchContactException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    return getPersistence()
170                                       .findByCompanyId_First(companyId, orderByComparator);
171            }
172    
173            public static com.liferay.portal.model.Contact findByCompanyId_Last(
174                    long companyId,
175                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
176                    throws com.liferay.portal.NoSuchContactException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getPersistence()
179                                       .findByCompanyId_Last(companyId, orderByComparator);
180            }
181    
182            public static com.liferay.portal.model.Contact[] findByCompanyId_PrevAndNext(
183                    long contactId, long companyId,
184                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
185                    throws com.liferay.portal.NoSuchContactException,
186                            com.liferay.portal.kernel.exception.SystemException {
187                    return getPersistence()
188                                       .findByCompanyId_PrevAndNext(contactId, companyId,
189                            orderByComparator);
190            }
191    
192            public static java.util.List<com.liferay.portal.model.Contact> findAll()
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().findAll();
195            }
196    
197            public static java.util.List<com.liferay.portal.model.Contact> findAll(
198                    int start, int end)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().findAll(start, end);
201            }
202    
203            public static java.util.List<com.liferay.portal.model.Contact> findAll(
204                    int start, int end,
205                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findAll(start, end, orderByComparator);
208            }
209    
210            public static void removeByCompanyId(long companyId)
211                    throws com.liferay.portal.kernel.exception.SystemException {
212                    getPersistence().removeByCompanyId(companyId);
213            }
214    
215            public static void removeAll()
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    getPersistence().removeAll();
218            }
219    
220            public static int countByCompanyId(long companyId)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().countByCompanyId(companyId);
223            }
224    
225            public static int countAll()
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getPersistence().countAll();
228            }
229    
230            public static ContactPersistence getPersistence() {
231                    if (_persistence == null) {
232                            _persistence = (ContactPersistence)PortalBeanLocatorUtil.locate(ContactPersistence.class.getName());
233                    }
234    
235                    return _persistence;
236            }
237    
238            public void setPersistence(ContactPersistence persistence) {
239                    _persistence = persistence;
240            }
241    
242            private static ContactPersistence _persistence;
243    }