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.model.Company;
020    
021    /**
022     * The persistence interface for the company service.
023     *
024     * <p>
025     * Caching information and settings can be found in <code>portal.properties</code>
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see com.liferay.portal.service.persistence.impl.CompanyPersistenceImpl
030     * @see CompanyUtil
031     * @generated
032     */
033    @ProviderType
034    public interface CompanyPersistence extends BasePersistence<Company> {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify or reference this interface directly. Always use {@link CompanyUtil} to access the company persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
039             */
040    
041            /**
042            * Returns the company where webId = &#63; or throws a {@link NoSuchCompanyException} if it could not be found.
043            *
044            * @param webId the web ID
045            * @return the matching company
046            * @throws NoSuchCompanyException if a matching company could not be found
047            */
048            public Company findByWebId(java.lang.String webId)
049                    throws com.liferay.portal.NoSuchCompanyException;
050    
051            /**
052            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
053            *
054            * @param webId the web ID
055            * @return the matching company, or <code>null</code> if a matching company could not be found
056            */
057            public Company fetchByWebId(java.lang.String webId);
058    
059            /**
060            * Returns the company where webId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
061            *
062            * @param webId the web ID
063            * @param retrieveFromCache whether to use the finder cache
064            * @return the matching company, or <code>null</code> if a matching company could not be found
065            */
066            public Company fetchByWebId(java.lang.String webId,
067                    boolean retrieveFromCache);
068    
069            /**
070            * Removes the company where webId = &#63; from the database.
071            *
072            * @param webId the web ID
073            * @return the company that was removed
074            */
075            public Company removeByWebId(java.lang.String webId)
076                    throws com.liferay.portal.NoSuchCompanyException;
077    
078            /**
079            * Returns the number of companies where webId = &#63;.
080            *
081            * @param webId the web ID
082            * @return the number of matching companies
083            */
084            public int countByWebId(java.lang.String webId);
085    
086            /**
087            * Returns the company where mx = &#63; or throws a {@link NoSuchCompanyException} if it could not be found.
088            *
089            * @param mx the mx
090            * @return the matching company
091            * @throws NoSuchCompanyException if a matching company could not be found
092            */
093            public Company findByMx(java.lang.String mx)
094                    throws com.liferay.portal.NoSuchCompanyException;
095    
096            /**
097            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
098            *
099            * @param mx the mx
100            * @return the matching company, or <code>null</code> if a matching company could not be found
101            */
102            public Company fetchByMx(java.lang.String mx);
103    
104            /**
105            * Returns the company where mx = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
106            *
107            * @param mx the mx
108            * @param retrieveFromCache whether to use the finder cache
109            * @return the matching company, or <code>null</code> if a matching company could not be found
110            */
111            public Company fetchByMx(java.lang.String mx, boolean retrieveFromCache);
112    
113            /**
114            * Removes the company where mx = &#63; from the database.
115            *
116            * @param mx the mx
117            * @return the company that was removed
118            */
119            public Company removeByMx(java.lang.String mx)
120                    throws com.liferay.portal.NoSuchCompanyException;
121    
122            /**
123            * Returns the number of companies where mx = &#63;.
124            *
125            * @param mx the mx
126            * @return the number of matching companies
127            */
128            public int countByMx(java.lang.String mx);
129    
130            /**
131            * Returns the company where logoId = &#63; or throws a {@link NoSuchCompanyException} if it could not be found.
132            *
133            * @param logoId the logo ID
134            * @return the matching company
135            * @throws NoSuchCompanyException if a matching company could not be found
136            */
137            public Company findByLogoId(long logoId)
138                    throws com.liferay.portal.NoSuchCompanyException;
139    
140            /**
141            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
142            *
143            * @param logoId the logo ID
144            * @return the matching company, or <code>null</code> if a matching company could not be found
145            */
146            public Company fetchByLogoId(long logoId);
147    
148            /**
149            * Returns the company where logoId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
150            *
151            * @param logoId the logo ID
152            * @param retrieveFromCache whether to use the finder cache
153            * @return the matching company, or <code>null</code> if a matching company could not be found
154            */
155            public Company fetchByLogoId(long logoId, boolean retrieveFromCache);
156    
157            /**
158            * Removes the company where logoId = &#63; from the database.
159            *
160            * @param logoId the logo ID
161            * @return the company that was removed
162            */
163            public Company removeByLogoId(long logoId)
164                    throws com.liferay.portal.NoSuchCompanyException;
165    
166            /**
167            * Returns the number of companies where logoId = &#63;.
168            *
169            * @param logoId the logo ID
170            * @return the number of matching companies
171            */
172            public int countByLogoId(long logoId);
173    
174            /**
175            * Returns all the companies where system = &#63;.
176            *
177            * @param system the system
178            * @return the matching companies
179            */
180            public java.util.List<Company> findBySystem(boolean system);
181    
182            /**
183            * Returns a range of all the companies where system = &#63;.
184            *
185            * <p>
186            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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.
187            * </p>
188            *
189            * @param system the system
190            * @param start the lower bound of the range of companies
191            * @param end the upper bound of the range of companies (not inclusive)
192            * @return the range of matching companies
193            */
194            public java.util.List<Company> findBySystem(boolean system, int start,
195                    int end);
196    
197            /**
198            * Returns an ordered range of all the companies where system = &#63;.
199            *
200            * <p>
201            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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.
202            * </p>
203            *
204            * @param system the system
205            * @param start the lower bound of the range of companies
206            * @param end the upper bound of the range of companies (not inclusive)
207            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
208            * @return the ordered range of matching companies
209            */
210            public java.util.List<Company> findBySystem(boolean system, int start,
211                    int end,
212                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator);
213    
214            /**
215            * Returns the first company in the ordered set where system = &#63;.
216            *
217            * @param system the system
218            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
219            * @return the first matching company
220            * @throws NoSuchCompanyException if a matching company could not be found
221            */
222            public Company findBySystem_First(boolean system,
223                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator)
224                    throws com.liferay.portal.NoSuchCompanyException;
225    
226            /**
227            * Returns the first company in the ordered set where system = &#63;.
228            *
229            * @param system the system
230            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
231            * @return the first matching company, or <code>null</code> if a matching company could not be found
232            */
233            public Company fetchBySystem_First(boolean system,
234                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator);
235    
236            /**
237            * Returns the last company in the ordered set where system = &#63;.
238            *
239            * @param system the system
240            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
241            * @return the last matching company
242            * @throws NoSuchCompanyException if a matching company could not be found
243            */
244            public Company findBySystem_Last(boolean system,
245                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator)
246                    throws com.liferay.portal.NoSuchCompanyException;
247    
248            /**
249            * Returns the last company in the ordered set where system = &#63;.
250            *
251            * @param system the system
252            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
253            * @return the last matching company, or <code>null</code> if a matching company could not be found
254            */
255            public Company fetchBySystem_Last(boolean system,
256                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator);
257    
258            /**
259            * Returns the companies before and after the current company in the ordered set where system = &#63;.
260            *
261            * @param companyId the primary key of the current company
262            * @param system the system
263            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
264            * @return the previous, current, and next company
265            * @throws NoSuchCompanyException if a company with the primary key could not be found
266            */
267            public Company[] findBySystem_PrevAndNext(long companyId, boolean system,
268                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator)
269                    throws com.liferay.portal.NoSuchCompanyException;
270    
271            /**
272            * Removes all the companies where system = &#63; from the database.
273            *
274            * @param system the system
275            */
276            public void removeBySystem(boolean system);
277    
278            /**
279            * Returns the number of companies where system = &#63;.
280            *
281            * @param system the system
282            * @return the number of matching companies
283            */
284            public int countBySystem(boolean system);
285    
286            /**
287            * Caches the company in the entity cache if it is enabled.
288            *
289            * @param company the company
290            */
291            public void cacheResult(Company company);
292    
293            /**
294            * Caches the companies in the entity cache if it is enabled.
295            *
296            * @param companies the companies
297            */
298            public void cacheResult(java.util.List<Company> companies);
299    
300            /**
301            * Creates a new company with the primary key. Does not add the company to the database.
302            *
303            * @param companyId the primary key for the new company
304            * @return the new company
305            */
306            public Company create(long companyId);
307    
308            /**
309            * Removes the company with the primary key from the database. Also notifies the appropriate model listeners.
310            *
311            * @param companyId the primary key of the company
312            * @return the company that was removed
313            * @throws NoSuchCompanyException if a company with the primary key could not be found
314            */
315            public Company remove(long companyId)
316                    throws com.liferay.portal.NoSuchCompanyException;
317    
318            public Company updateImpl(Company company);
319    
320            /**
321            * Returns the company with the primary key or throws a {@link NoSuchCompanyException} if it could not be found.
322            *
323            * @param companyId the primary key of the company
324            * @return the company
325            * @throws NoSuchCompanyException if a company with the primary key could not be found
326            */
327            public Company findByPrimaryKey(long companyId)
328                    throws com.liferay.portal.NoSuchCompanyException;
329    
330            /**
331            * Returns the company with the primary key or returns <code>null</code> if it could not be found.
332            *
333            * @param companyId the primary key of the company
334            * @return the company, or <code>null</code> if a company with the primary key could not be found
335            */
336            public Company fetchByPrimaryKey(long companyId);
337    
338            @Override
339            public java.util.Map<java.io.Serializable, Company> fetchByPrimaryKeys(
340                    java.util.Set<java.io.Serializable> primaryKeys);
341    
342            /**
343            * Returns all the companies.
344            *
345            * @return the companies
346            */
347            public java.util.List<Company> findAll();
348    
349            /**
350            * Returns a range of all the companies.
351            *
352            * <p>
353            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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.
354            * </p>
355            *
356            * @param start the lower bound of the range of companies
357            * @param end the upper bound of the range of companies (not inclusive)
358            * @return the range of companies
359            */
360            public java.util.List<Company> findAll(int start, int end);
361    
362            /**
363            * Returns an ordered range of all the companies.
364            *
365            * <p>
366            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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.
367            * </p>
368            *
369            * @param start the lower bound of the range of companies
370            * @param end the upper bound of the range of companies (not inclusive)
371            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
372            * @return the ordered range of companies
373            */
374            public java.util.List<Company> findAll(int start, int end,
375                    com.liferay.portal.kernel.util.OrderByComparator<Company> orderByComparator);
376    
377            /**
378            * Removes all the companies from the database.
379            */
380            public void removeAll();
381    
382            /**
383            * Returns the number of companies.
384            *
385            * @return the number of companies
386            */
387            public int countAll();
388    }