1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  import com.liferay.portal.NoSuchCompanyException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.cache.CacheRegistry;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
31  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
32  import com.liferay.portal.kernel.dao.orm.FinderPath;
33  import com.liferay.portal.kernel.dao.orm.Query;
34  import com.liferay.portal.kernel.dao.orm.QueryPos;
35  import com.liferay.portal.kernel.dao.orm.QueryUtil;
36  import com.liferay.portal.kernel.dao.orm.Session;
37  import com.liferay.portal.kernel.log.Log;
38  import com.liferay.portal.kernel.log.LogFactoryUtil;
39  import com.liferay.portal.kernel.util.GetterUtil;
40  import com.liferay.portal.kernel.util.OrderByComparator;
41  import com.liferay.portal.kernel.util.StringPool;
42  import com.liferay.portal.kernel.util.StringUtil;
43  import com.liferay.portal.kernel.util.Validator;
44  import com.liferay.portal.model.Company;
45  import com.liferay.portal.model.ModelListener;
46  import com.liferay.portal.model.impl.CompanyImpl;
47  import com.liferay.portal.model.impl.CompanyModelImpl;
48  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
49  
50  import java.util.ArrayList;
51  import java.util.Collections;
52  import java.util.List;
53  
54  /**
55   * <a href="CompanyPersistenceImpl.java.html"><b><i>View Source</i></b></a>
56   *
57   * <p>
58   * ServiceBuilder generated this class. Modifications in this class will be
59   * overwritten the next time is generated.
60   * </p>
61   *
62   * @author    Brian Wing Shun Chan
63   * @see       CompanyPersistence
64   * @see       CompanyUtil
65   * @generated
66   */
67  public class CompanyPersistenceImpl extends BasePersistenceImpl
68      implements CompanyPersistence {
69      public static final String FINDER_CLASS_NAME_ENTITY = CompanyImpl.class.getName();
70      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
71          ".List";
72      public static final FinderPath FINDER_PATH_FETCH_BY_WEBID = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
73              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
74              "fetchByWebId", new String[] { String.class.getName() });
75      public static final FinderPath FINDER_PATH_COUNT_BY_WEBID = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
76              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
77              "countByWebId", new String[] { String.class.getName() });
78      public static final FinderPath FINDER_PATH_FETCH_BY_VIRTUALHOST = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
79              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
80              "fetchByVirtualHost", new String[] { String.class.getName() });
81      public static final FinderPath FINDER_PATH_COUNT_BY_VIRTUALHOST = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
82              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
83              "countByVirtualHost", new String[] { String.class.getName() });
84      public static final FinderPath FINDER_PATH_FETCH_BY_MX = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
85              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
86              "fetchByMx", new String[] { String.class.getName() });
87      public static final FinderPath FINDER_PATH_COUNT_BY_MX = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
88              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
89              "countByMx", new String[] { String.class.getName() });
90      public static final FinderPath FINDER_PATH_FETCH_BY_LOGOID = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
91              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
92              "fetchByLogoId", new String[] { Long.class.getName() });
93      public static final FinderPath FINDER_PATH_COUNT_BY_LOGOID = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
94              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
95              "countByLogoId", new String[] { Long.class.getName() });
96      public static final FinderPath FINDER_PATH_FIND_BY_SYSTEM = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
97              CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
98              "findBySystem", new String[] { Boolean.class.getName() });
99      public static final FinderPath FINDER_PATH_FIND_BY_OBC_SYSTEM = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
100             CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
101             "findBySystem",
102             new String[] {
103                 Boolean.class.getName(),
104                 
105             "java.lang.Integer", "java.lang.Integer",
106                 "com.liferay.portal.kernel.util.OrderByComparator"
107             });
108     public static final FinderPath FINDER_PATH_COUNT_BY_SYSTEM = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
109             CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
110             "countBySystem", new String[] { Boolean.class.getName() });
111     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
112             CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
113             "findAll", new String[0]);
114     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(CompanyModelImpl.ENTITY_CACHE_ENABLED,
115             CompanyModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
116             "countAll", new String[0]);
117 
118     public void cacheResult(Company company) {
119         EntityCacheUtil.putResult(CompanyModelImpl.ENTITY_CACHE_ENABLED,
120             CompanyImpl.class, company.getPrimaryKey(), company);
121 
122         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WEBID,
123             new Object[] { company.getWebId() }, company);
124 
125         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
126             new Object[] { company.getVirtualHost() }, company);
127 
128         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_MX,
129             new Object[] { company.getMx() }, company);
130 
131         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGOID,
132             new Object[] { new Long(company.getLogoId()) }, company);
133     }
134 
135     public void cacheResult(List<Company> companies) {
136         for (Company company : companies) {
137             if (EntityCacheUtil.getResult(
138                         CompanyModelImpl.ENTITY_CACHE_ENABLED,
139                         CompanyImpl.class, company.getPrimaryKey(), this) == null) {
140                 cacheResult(company);
141             }
142         }
143     }
144 
145     public void clearCache() {
146         CacheRegistry.clear(CompanyImpl.class.getName());
147         EntityCacheUtil.clearCache(CompanyImpl.class.getName());
148         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
149         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
150     }
151 
152     public Company create(long companyId) {
153         Company company = new CompanyImpl();
154 
155         company.setNew(true);
156         company.setPrimaryKey(companyId);
157 
158         return company;
159     }
160 
161     public Company remove(long companyId)
162         throws NoSuchCompanyException, SystemException {
163         Session session = null;
164 
165         try {
166             session = openSession();
167 
168             Company company = (Company)session.get(CompanyImpl.class,
169                     new Long(companyId));
170 
171             if (company == null) {
172                 if (_log.isWarnEnabled()) {
173                     _log.warn("No Company exists with the primary key " +
174                         companyId);
175                 }
176 
177                 throw new NoSuchCompanyException(
178                     "No Company exists with the primary key " + companyId);
179             }
180 
181             return remove(company);
182         }
183         catch (NoSuchCompanyException nsee) {
184             throw nsee;
185         }
186         catch (Exception e) {
187             throw processException(e);
188         }
189         finally {
190             closeSession(session);
191         }
192     }
193 
194     public Company remove(Company company) throws SystemException {
195         for (ModelListener<Company> listener : listeners) {
196             listener.onBeforeRemove(company);
197         }
198 
199         company = removeImpl(company);
200 
201         for (ModelListener<Company> listener : listeners) {
202             listener.onAfterRemove(company);
203         }
204 
205         return company;
206     }
207 
208     protected Company removeImpl(Company company) throws SystemException {
209         Session session = null;
210 
211         try {
212             session = openSession();
213 
214             if (company.isCachedModel() || BatchSessionUtil.isEnabled()) {
215                 Object staleObject = session.get(CompanyImpl.class,
216                         company.getPrimaryKeyObj());
217 
218                 if (staleObject != null) {
219                     session.evict(staleObject);
220                 }
221             }
222 
223             session.delete(company);
224 
225             session.flush();
226         }
227         catch (Exception e) {
228             throw processException(e);
229         }
230         finally {
231             closeSession(session);
232         }
233 
234         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
235 
236         CompanyModelImpl companyModelImpl = (CompanyModelImpl)company;
237 
238         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_WEBID,
239             new Object[] { companyModelImpl.getOriginalWebId() });
240 
241         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
242             new Object[] { companyModelImpl.getOriginalVirtualHost() });
243 
244         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_MX,
245             new Object[] { companyModelImpl.getOriginalMx() });
246 
247         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_LOGOID,
248             new Object[] { new Long(companyModelImpl.getOriginalLogoId()) });
249 
250         EntityCacheUtil.removeResult(CompanyModelImpl.ENTITY_CACHE_ENABLED,
251             CompanyImpl.class, company.getPrimaryKey());
252 
253         return company;
254     }
255 
256     /**
257      * @deprecated Use {@link #update(Company, boolean merge)}.
258      */
259     public Company update(Company company) throws SystemException {
260         if (_log.isWarnEnabled()) {
261             _log.warn(
262                 "Using the deprecated update(Company company) method. Use update(Company company, boolean merge) instead.");
263         }
264 
265         return update(company, false);
266     }
267 
268     /**
269      * Add, update, or merge, the entity. This method also calls the model
270      * listeners to trigger the proper events associated with adding, deleting,
271      * or updating an entity.
272      *
273      * @param  company the entity to add, update, or merge
274      * @param  merge boolean value for whether to merge the entity. The default
275      *         value is false. Setting merge to true is more expensive and
276      *         should only be true when company is transient. See
277      *         LEP-5473 for a detailed discussion of this method.
278      * @return the entity that was added, updated, or merged
279      */
280     public Company update(Company company, boolean merge)
281         throws SystemException {
282         boolean isNew = company.isNew();
283 
284         for (ModelListener<Company> listener : listeners) {
285             if (isNew) {
286                 listener.onBeforeCreate(company);
287             }
288             else {
289                 listener.onBeforeUpdate(company);
290             }
291         }
292 
293         company = updateImpl(company, merge);
294 
295         for (ModelListener<Company> listener : listeners) {
296             if (isNew) {
297                 listener.onAfterCreate(company);
298             }
299             else {
300                 listener.onAfterUpdate(company);
301             }
302         }
303 
304         return company;
305     }
306 
307     public Company updateImpl(com.liferay.portal.model.Company company,
308         boolean merge) throws SystemException {
309         boolean isNew = company.isNew();
310 
311         CompanyModelImpl companyModelImpl = (CompanyModelImpl)company;
312 
313         Session session = null;
314 
315         try {
316             session = openSession();
317 
318             BatchSessionUtil.update(session, company, merge);
319 
320             company.setNew(false);
321         }
322         catch (Exception e) {
323             throw processException(e);
324         }
325         finally {
326             closeSession(session);
327         }
328 
329         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
330 
331         EntityCacheUtil.putResult(CompanyModelImpl.ENTITY_CACHE_ENABLED,
332             CompanyImpl.class, company.getPrimaryKey(), company);
333 
334         if (!isNew &&
335                 (!Validator.equals(company.getWebId(),
336                     companyModelImpl.getOriginalWebId()))) {
337             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_WEBID,
338                 new Object[] { companyModelImpl.getOriginalWebId() });
339         }
340 
341         if (isNew ||
342                 (!Validator.equals(company.getWebId(),
343                     companyModelImpl.getOriginalWebId()))) {
344             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WEBID,
345                 new Object[] { company.getWebId() }, company);
346         }
347 
348         if (!isNew &&
349                 (!Validator.equals(company.getVirtualHost(),
350                     companyModelImpl.getOriginalVirtualHost()))) {
351             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
352                 new Object[] { companyModelImpl.getOriginalVirtualHost() });
353         }
354 
355         if (isNew ||
356                 (!Validator.equals(company.getVirtualHost(),
357                     companyModelImpl.getOriginalVirtualHost()))) {
358             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
359                 new Object[] { company.getVirtualHost() }, company);
360         }
361 
362         if (!isNew &&
363                 (!Validator.equals(company.getMx(),
364                     companyModelImpl.getOriginalMx()))) {
365             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_MX,
366                 new Object[] { companyModelImpl.getOriginalMx() });
367         }
368 
369         if (isNew ||
370                 (!Validator.equals(company.getMx(),
371                     companyModelImpl.getOriginalMx()))) {
372             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_MX,
373                 new Object[] { company.getMx() }, company);
374         }
375 
376         if (!isNew &&
377                 (company.getLogoId() != companyModelImpl.getOriginalLogoId())) {
378             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_LOGOID,
379                 new Object[] { new Long(companyModelImpl.getOriginalLogoId()) });
380         }
381 
382         if (isNew ||
383                 (company.getLogoId() != companyModelImpl.getOriginalLogoId())) {
384             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGOID,
385                 new Object[] { new Long(company.getLogoId()) }, company);
386         }
387 
388         return company;
389     }
390 
391     public Company findByPrimaryKey(long companyId)
392         throws NoSuchCompanyException, SystemException {
393         Company company = fetchByPrimaryKey(companyId);
394 
395         if (company == null) {
396             if (_log.isWarnEnabled()) {
397                 _log.warn("No Company exists with the primary key " +
398                     companyId);
399             }
400 
401             throw new NoSuchCompanyException(
402                 "No Company exists with the primary key " + companyId);
403         }
404 
405         return company;
406     }
407 
408     public Company fetchByPrimaryKey(long companyId) throws SystemException {
409         Company company = (Company)EntityCacheUtil.getResult(CompanyModelImpl.ENTITY_CACHE_ENABLED,
410                 CompanyImpl.class, companyId, this);
411 
412         if (company == null) {
413             Session session = null;
414 
415             try {
416                 session = openSession();
417 
418                 company = (Company)session.get(CompanyImpl.class,
419                         new Long(companyId));
420             }
421             catch (Exception e) {
422                 throw processException(e);
423             }
424             finally {
425                 if (company != null) {
426                     cacheResult(company);
427                 }
428 
429                 closeSession(session);
430             }
431         }
432 
433         return company;
434     }
435 
436     public Company findByWebId(String webId)
437         throws NoSuchCompanyException, SystemException {
438         Company company = fetchByWebId(webId);
439 
440         if (company == null) {
441             StringBuilder msg = new StringBuilder();
442 
443             msg.append("No Company exists with the key {");
444 
445             msg.append("webId=" + webId);
446 
447             msg.append(StringPool.CLOSE_CURLY_BRACE);
448 
449             if (_log.isWarnEnabled()) {
450                 _log.warn(msg.toString());
451             }
452 
453             throw new NoSuchCompanyException(msg.toString());
454         }
455 
456         return company;
457     }
458 
459     public Company fetchByWebId(String webId) throws SystemException {
460         return fetchByWebId(webId, true);
461     }
462 
463     public Company fetchByWebId(String webId, boolean retrieveFromCache)
464         throws SystemException {
465         Object[] finderArgs = new Object[] { webId };
466 
467         Object result = null;
468 
469         if (retrieveFromCache) {
470             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_WEBID,
471                     finderArgs, this);
472         }
473 
474         if (result == null) {
475             Session session = null;
476 
477             try {
478                 session = openSession();
479 
480                 StringBuilder query = new StringBuilder();
481 
482                 query.append("SELECT company FROM Company company WHERE ");
483 
484                 if (webId == null) {
485                     query.append("company.webId IS NULL");
486                 }
487                 else {
488                     query.append("company.webId = ?");
489                 }
490 
491                 query.append(" ");
492 
493                 Query q = session.createQuery(query.toString());
494 
495                 QueryPos qPos = QueryPos.getInstance(q);
496 
497                 if (webId != null) {
498                     qPos.add(webId);
499                 }
500 
501                 List<Company> list = q.list();
502 
503                 result = list;
504 
505                 Company company = null;
506 
507                 if (list.isEmpty()) {
508                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WEBID,
509                         finderArgs, list);
510                 }
511                 else {
512                     company = list.get(0);
513 
514                     cacheResult(company);
515 
516                     if ((company.getWebId() == null) ||
517                             !company.getWebId().equals(webId)) {
518                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WEBID,
519                             finderArgs, company);
520                     }
521                 }
522 
523                 return company;
524             }
525             catch (Exception e) {
526                 throw processException(e);
527             }
528             finally {
529                 if (result == null) {
530                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WEBID,
531                         finderArgs, new ArrayList<Company>());
532                 }
533 
534                 closeSession(session);
535             }
536         }
537         else {
538             if (result instanceof List<?>) {
539                 return null;
540             }
541             else {
542                 return (Company)result;
543             }
544         }
545     }
546 
547     public Company findByVirtualHost(String virtualHost)
548         throws NoSuchCompanyException, SystemException {
549         Company company = fetchByVirtualHost(virtualHost);
550 
551         if (company == null) {
552             StringBuilder msg = new StringBuilder();
553 
554             msg.append("No Company exists with the key {");
555 
556             msg.append("virtualHost=" + virtualHost);
557 
558             msg.append(StringPool.CLOSE_CURLY_BRACE);
559 
560             if (_log.isWarnEnabled()) {
561                 _log.warn(msg.toString());
562             }
563 
564             throw new NoSuchCompanyException(msg.toString());
565         }
566 
567         return company;
568     }
569 
570     public Company fetchByVirtualHost(String virtualHost)
571         throws SystemException {
572         return fetchByVirtualHost(virtualHost, true);
573     }
574 
575     public Company fetchByVirtualHost(String virtualHost,
576         boolean retrieveFromCache) throws SystemException {
577         Object[] finderArgs = new Object[] { virtualHost };
578 
579         Object result = null;
580 
581         if (retrieveFromCache) {
582             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
583                     finderArgs, this);
584         }
585 
586         if (result == null) {
587             Session session = null;
588 
589             try {
590                 session = openSession();
591 
592                 StringBuilder query = new StringBuilder();
593 
594                 query.append("SELECT company FROM Company company WHERE ");
595 
596                 if (virtualHost == null) {
597                     query.append("company.virtualHost IS NULL");
598                 }
599                 else {
600                     query.append("company.virtualHost = ?");
601                 }
602 
603                 query.append(" ");
604 
605                 Query q = session.createQuery(query.toString());
606 
607                 QueryPos qPos = QueryPos.getInstance(q);
608 
609                 if (virtualHost != null) {
610                     qPos.add(virtualHost);
611                 }
612 
613                 List<Company> list = q.list();
614 
615                 result = list;
616 
617                 Company company = null;
618 
619                 if (list.isEmpty()) {
620                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
621                         finderArgs, list);
622                 }
623                 else {
624                     company = list.get(0);
625 
626                     cacheResult(company);
627 
628                     if ((company.getVirtualHost() == null) ||
629                             !company.getVirtualHost().equals(virtualHost)) {
630                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
631                             finderArgs, company);
632                     }
633                 }
634 
635                 return company;
636             }
637             catch (Exception e) {
638                 throw processException(e);
639             }
640             finally {
641                 if (result == null) {
642                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
643                         finderArgs, new ArrayList<Company>());
644                 }
645 
646                 closeSession(session);
647             }
648         }
649         else {
650             if (result instanceof List<?>) {
651                 return null;
652             }
653             else {
654                 return (Company)result;
655             }
656         }
657     }
658 
659     public Company findByMx(String mx)
660         throws NoSuchCompanyException, SystemException {
661         Company company = fetchByMx(mx);
662 
663         if (company == null) {
664             StringBuilder msg = new StringBuilder();
665 
666             msg.append("No Company exists with the key {");
667 
668             msg.append("mx=" + mx);
669 
670             msg.append(StringPool.CLOSE_CURLY_BRACE);
671 
672             if (_log.isWarnEnabled()) {
673                 _log.warn(msg.toString());
674             }
675 
676             throw new NoSuchCompanyException(msg.toString());
677         }
678 
679         return company;
680     }
681 
682     public Company fetchByMx(String mx) throws SystemException {
683         return fetchByMx(mx, true);
684     }
685 
686     public Company fetchByMx(String mx, boolean retrieveFromCache)
687         throws SystemException {
688         Object[] finderArgs = new Object[] { mx };
689 
690         Object result = null;
691 
692         if (retrieveFromCache) {
693             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_MX,
694                     finderArgs, this);
695         }
696 
697         if (result == null) {
698             Session session = null;
699 
700             try {
701                 session = openSession();
702 
703                 StringBuilder query = new StringBuilder();
704 
705                 query.append("SELECT company FROM Company company WHERE ");
706 
707                 if (mx == null) {
708                     query.append("company.mx IS NULL");
709                 }
710                 else {
711                     query.append("company.mx = ?");
712                 }
713 
714                 query.append(" ");
715 
716                 Query q = session.createQuery(query.toString());
717 
718                 QueryPos qPos = QueryPos.getInstance(q);
719 
720                 if (mx != null) {
721                     qPos.add(mx);
722                 }
723 
724                 List<Company> list = q.list();
725 
726                 result = list;
727 
728                 Company company = null;
729 
730                 if (list.isEmpty()) {
731                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_MX,
732                         finderArgs, list);
733                 }
734                 else {
735                     company = list.get(0);
736 
737                     cacheResult(company);
738 
739                     if ((company.getMx() == null) ||
740                             !company.getMx().equals(mx)) {
741                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_MX,
742                             finderArgs, company);
743                     }
744                 }
745 
746                 return company;
747             }
748             catch (Exception e) {
749                 throw processException(e);
750             }
751             finally {
752                 if (result == null) {
753                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_MX,
754                         finderArgs, new ArrayList<Company>());
755                 }
756 
757                 closeSession(session);
758             }
759         }
760         else {
761             if (result instanceof List<?>) {
762                 return null;
763             }
764             else {
765                 return (Company)result;
766             }
767         }
768     }
769 
770     public Company findByLogoId(long logoId)
771         throws NoSuchCompanyException, SystemException {
772         Company company = fetchByLogoId(logoId);
773 
774         if (company == null) {
775             StringBuilder msg = new StringBuilder();
776 
777             msg.append("No Company exists with the key {");
778 
779             msg.append("logoId=" + logoId);
780 
781             msg.append(StringPool.CLOSE_CURLY_BRACE);
782 
783             if (_log.isWarnEnabled()) {
784                 _log.warn(msg.toString());
785             }
786 
787             throw new NoSuchCompanyException(msg.toString());
788         }
789 
790         return company;
791     }
792 
793     public Company fetchByLogoId(long logoId) throws SystemException {
794         return fetchByLogoId(logoId, true);
795     }
796 
797     public Company fetchByLogoId(long logoId, boolean retrieveFromCache)
798         throws SystemException {
799         Object[] finderArgs = new Object[] { new Long(logoId) };
800 
801         Object result = null;
802 
803         if (retrieveFromCache) {
804             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_LOGOID,
805                     finderArgs, this);
806         }
807 
808         if (result == null) {
809             Session session = null;
810 
811             try {
812                 session = openSession();
813 
814                 StringBuilder query = new StringBuilder();
815 
816                 query.append("SELECT company FROM Company company WHERE ");
817 
818                 query.append("company.logoId = ?");
819 
820                 query.append(" ");
821 
822                 Query q = session.createQuery(query.toString());
823 
824                 QueryPos qPos = QueryPos.getInstance(q);
825 
826                 qPos.add(logoId);
827 
828                 List<Company> list = q.list();
829 
830                 result = list;
831 
832                 Company company = null;
833 
834                 if (list.isEmpty()) {
835                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGOID,
836                         finderArgs, list);
837                 }
838                 else {
839                     company = list.get(0);
840 
841                     cacheResult(company);
842 
843                     if ((company.getLogoId() != logoId)) {
844                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGOID,
845                             finderArgs, company);
846                     }
847                 }
848 
849                 return company;
850             }
851             catch (Exception e) {
852                 throw processException(e);
853             }
854             finally {
855                 if (result == null) {
856                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_LOGOID,
857                         finderArgs, new ArrayList<Company>());
858                 }
859 
860                 closeSession(session);
861             }
862         }
863         else {
864             if (result instanceof List<?>) {
865                 return null;
866             }
867             else {
868                 return (Company)result;
869             }
870         }
871     }
872 
873     public List<Company> findBySystem(boolean system) throws SystemException {
874         Object[] finderArgs = new Object[] { Boolean.valueOf(system) };
875 
876         List<Company> list = (List<Company>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_SYSTEM,
877                 finderArgs, this);
878 
879         if (list == null) {
880             Session session = null;
881 
882             try {
883                 session = openSession();
884 
885                 StringBuilder query = new StringBuilder();
886 
887                 query.append("SELECT company FROM Company company WHERE ");
888 
889                 query.append("company.system = ?");
890 
891                 query.append(" ");
892 
893                 Query q = session.createQuery(query.toString());
894 
895                 QueryPos qPos = QueryPos.getInstance(q);
896 
897                 qPos.add(system);
898 
899                 list = q.list();
900             }
901             catch (Exception e) {
902                 throw processException(e);
903             }
904             finally {
905                 if (list == null) {
906                     list = new ArrayList<Company>();
907                 }
908 
909                 cacheResult(list);
910 
911                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_SYSTEM,
912                     finderArgs, list);
913 
914                 closeSession(session);
915             }
916         }
917 
918         return list;
919     }
920 
921     public List<Company> findBySystem(boolean system, int start, int end)
922         throws SystemException {
923         return findBySystem(system, start, end, null);
924     }
925 
926     public List<Company> findBySystem(boolean system, int start, int end,
927         OrderByComparator obc) throws SystemException {
928         Object[] finderArgs = new Object[] {
929                 Boolean.valueOf(system),
930                 
931                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
932             };
933 
934         List<Company> list = (List<Company>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_SYSTEM,
935                 finderArgs, this);
936 
937         if (list == null) {
938             Session session = null;
939 
940             try {
941                 session = openSession();
942 
943                 StringBuilder query = new StringBuilder();
944 
945                 query.append("SELECT company FROM Company company WHERE ");
946 
947                 query.append("company.system = ?");
948 
949                 query.append(" ");
950 
951                 if (obc != null) {
952                     query.append("ORDER BY ");
953 
954                     String[] orderByFields = obc.getOrderByFields();
955 
956                     for (int i = 0; i < orderByFields.length; i++) {
957                         query.append("company.");
958                         query.append(orderByFields[i]);
959 
960                         if (obc.isAscending()) {
961                             query.append(" ASC");
962                         }
963                         else {
964                             query.append(" DESC");
965                         }
966 
967                         if ((i + 1) < orderByFields.length) {
968                             query.append(", ");
969                         }
970                     }
971                 }
972 
973                 Query q = session.createQuery(query.toString());
974 
975                 QueryPos qPos = QueryPos.getInstance(q);
976 
977                 qPos.add(system);
978 
979                 list = (List<Company>)QueryUtil.list(q, getDialect(), start, end);
980             }
981             catch (Exception e) {
982                 throw processException(e);
983             }
984             finally {
985                 if (list == null) {
986                     list = new ArrayList<Company>();
987                 }
988 
989                 cacheResult(list);
990 
991                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_SYSTEM,
992                     finderArgs, list);
993 
994                 closeSession(session);
995             }
996         }
997 
998         return list;
999     }
1000
1001    public Company findBySystem_First(boolean system, OrderByComparator obc)
1002        throws NoSuchCompanyException, SystemException {
1003        List<Company> list = findBySystem(system, 0, 1, obc);
1004
1005        if (list.isEmpty()) {
1006            StringBuilder msg = new StringBuilder();
1007
1008            msg.append("No Company exists with the key {");
1009
1010            msg.append("system=" + system);
1011
1012            msg.append(StringPool.CLOSE_CURLY_BRACE);
1013
1014            throw new NoSuchCompanyException(msg.toString());
1015        }
1016        else {
1017            return list.get(0);
1018        }
1019    }
1020
1021    public Company findBySystem_Last(boolean system, OrderByComparator obc)
1022        throws NoSuchCompanyException, SystemException {
1023        int count = countBySystem(system);
1024
1025        List<Company> list = findBySystem(system, count - 1, count, obc);
1026
1027        if (list.isEmpty()) {
1028            StringBuilder msg = new StringBuilder();
1029
1030            msg.append("No Company exists with the key {");
1031
1032            msg.append("system=" + system);
1033
1034            msg.append(StringPool.CLOSE_CURLY_BRACE);
1035
1036            throw new NoSuchCompanyException(msg.toString());
1037        }
1038        else {
1039            return list.get(0);
1040        }
1041    }
1042
1043    public Company[] findBySystem_PrevAndNext(long companyId, boolean system,
1044        OrderByComparator obc) throws NoSuchCompanyException, SystemException {
1045        Company company = findByPrimaryKey(companyId);
1046
1047        int count = countBySystem(system);
1048
1049        Session session = null;
1050
1051        try {
1052            session = openSession();
1053
1054            StringBuilder query = new StringBuilder();
1055
1056            query.append("SELECT company FROM Company company WHERE ");
1057
1058            query.append("company.system = ?");
1059
1060            query.append(" ");
1061
1062            if (obc != null) {
1063                query.append("ORDER BY ");
1064
1065                String[] orderByFields = obc.getOrderByFields();
1066
1067                for (int i = 0; i < orderByFields.length; i++) {
1068                    query.append("company.");
1069                    query.append(orderByFields[i]);
1070
1071                    if (obc.isAscending()) {
1072                        query.append(" ASC");
1073                    }
1074                    else {
1075                        query.append(" DESC");
1076                    }
1077
1078                    if ((i + 1) < orderByFields.length) {
1079                        query.append(", ");
1080                    }
1081                }
1082            }
1083
1084            Query q = session.createQuery(query.toString());
1085
1086            QueryPos qPos = QueryPos.getInstance(q);
1087
1088            qPos.add(system);
1089
1090            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, company);
1091
1092            Company[] array = new CompanyImpl[3];
1093
1094            array[0] = (Company)objArray[0];
1095            array[1] = (Company)objArray[1];
1096            array[2] = (Company)objArray[2];
1097
1098            return array;
1099        }
1100        catch (Exception e) {
1101            throw processException(e);
1102        }
1103        finally {
1104            closeSession(session);
1105        }
1106    }
1107
1108    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1109        throws SystemException {
1110        Session session = null;
1111
1112        try {
1113            session = openSession();
1114
1115            dynamicQuery.compile(session);
1116
1117            return dynamicQuery.list();
1118        }
1119        catch (Exception e) {
1120            throw processException(e);
1121        }
1122        finally {
1123            closeSession(session);
1124        }
1125    }
1126
1127    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1128        int start, int end) throws SystemException {
1129        Session session = null;
1130
1131        try {
1132            session = openSession();
1133
1134            dynamicQuery.setLimit(start, end);
1135
1136            dynamicQuery.compile(session);
1137
1138            return dynamicQuery.list();
1139        }
1140        catch (Exception e) {
1141            throw processException(e);
1142        }
1143        finally {
1144            closeSession(session);
1145        }
1146    }
1147
1148    public List<Company> findAll() throws SystemException {
1149        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1150    }
1151
1152    public List<Company> findAll(int start, int end) throws SystemException {
1153        return findAll(start, end, null);
1154    }
1155
1156    public List<Company> findAll(int start, int end, OrderByComparator obc)
1157        throws SystemException {
1158        Object[] finderArgs = new Object[] {
1159                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1160            };
1161
1162        List<Company> list = (List<Company>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1163                finderArgs, this);
1164
1165        if (list == null) {
1166            Session session = null;
1167
1168            try {
1169                session = openSession();
1170
1171                StringBuilder query = new StringBuilder();
1172
1173                query.append("SELECT company FROM Company company ");
1174
1175                if (obc != null) {
1176                    query.append("ORDER BY ");
1177
1178                    String[] orderByFields = obc.getOrderByFields();
1179
1180                    for (int i = 0; i < orderByFields.length; i++) {
1181                        query.append("company.");
1182                        query.append(orderByFields[i]);
1183
1184                        if (obc.isAscending()) {
1185                            query.append(" ASC");
1186                        }
1187                        else {
1188                            query.append(" DESC");
1189                        }
1190
1191                        if ((i + 1) < orderByFields.length) {
1192                            query.append(", ");
1193                        }
1194                    }
1195                }
1196
1197                Query q = session.createQuery(query.toString());
1198
1199                if (obc == null) {
1200                    list = (List<Company>)QueryUtil.list(q, getDialect(),
1201                            start, end, false);
1202
1203                    Collections.sort(list);
1204                }
1205                else {
1206                    list = (List<Company>)QueryUtil.list(q, getDialect(),
1207                            start, end);
1208                }
1209            }
1210            catch (Exception e) {
1211                throw processException(e);
1212            }
1213            finally {
1214                if (list == null) {
1215                    list = new ArrayList<Company>();
1216                }
1217
1218                cacheResult(list);
1219
1220                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1221
1222                closeSession(session);
1223            }
1224        }
1225
1226        return list;
1227    }
1228
1229    public void removeByWebId(String webId)
1230        throws NoSuchCompanyException, SystemException {
1231        Company company = findByWebId(webId);
1232
1233        remove(company);
1234    }
1235
1236    public void removeByVirtualHost(String virtualHost)
1237        throws NoSuchCompanyException, SystemException {
1238        Company company = findByVirtualHost(virtualHost);
1239
1240        remove(company);
1241    }
1242
1243    public void removeByMx(String mx)
1244        throws NoSuchCompanyException, SystemException {
1245        Company company = findByMx(mx);
1246
1247        remove(company);
1248    }
1249
1250    public void removeByLogoId(long logoId)
1251        throws NoSuchCompanyException, SystemException {
1252        Company company = findByLogoId(logoId);
1253
1254        remove(company);
1255    }
1256
1257    public void removeBySystem(boolean system) throws SystemException {
1258        for (Company company : findBySystem(system)) {
1259            remove(company);
1260        }
1261    }
1262
1263    public void removeAll() throws SystemException {
1264        for (Company company : findAll()) {
1265            remove(company);
1266        }
1267    }
1268
1269    public int countByWebId(String webId) throws SystemException {
1270        Object[] finderArgs = new Object[] { webId };
1271
1272        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_WEBID,
1273                finderArgs, this);
1274
1275        if (count == null) {
1276            Session session = null;
1277
1278            try {
1279                session = openSession();
1280
1281                StringBuilder query = new StringBuilder();
1282
1283                query.append("SELECT COUNT(company) ");
1284                query.append("FROM Company company WHERE ");
1285
1286                if (webId == null) {
1287                    query.append("company.webId IS NULL");
1288                }
1289                else {
1290                    query.append("company.webId = ?");
1291                }
1292
1293                query.append(" ");
1294
1295                Query q = session.createQuery(query.toString());
1296
1297                QueryPos qPos = QueryPos.getInstance(q);
1298
1299                if (webId != null) {
1300                    qPos.add(webId);
1301                }
1302
1303                count = (Long)q.uniqueResult();
1304            }
1305            catch (Exception e) {
1306                throw processException(e);
1307            }
1308            finally {
1309                if (count == null) {
1310                    count = Long.valueOf(0);
1311                }
1312
1313                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_WEBID,
1314                    finderArgs, count);
1315
1316                closeSession(session);
1317            }
1318        }
1319
1320        return count.intValue();
1321    }
1322
1323    public int countByVirtualHost(String virtualHost) throws SystemException {
1324        Object[] finderArgs = new Object[] { virtualHost };
1325
1326        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_VIRTUALHOST,
1327                finderArgs, this);
1328
1329        if (count == null) {
1330            Session session = null;
1331
1332            try {
1333                session = openSession();
1334
1335                StringBuilder query = new StringBuilder();
1336
1337                query.append("SELECT COUNT(company) ");
1338                query.append("FROM Company company WHERE ");
1339
1340                if (virtualHost == null) {
1341                    query.append("company.virtualHost IS NULL");
1342                }
1343                else {
1344                    query.append("company.virtualHost = ?");
1345                }
1346
1347                query.append(" ");
1348
1349                Query q = session.createQuery(query.toString());
1350
1351                QueryPos qPos = QueryPos.getInstance(q);
1352
1353                if (virtualHost != null) {
1354                    qPos.add(virtualHost);
1355                }
1356
1357                count = (Long)q.uniqueResult();
1358            }
1359            catch (Exception e) {
1360                throw processException(e);
1361            }
1362            finally {
1363                if (count == null) {
1364                    count = Long.valueOf(0);
1365                }
1366
1367                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_VIRTUALHOST,
1368                    finderArgs, count);
1369
1370                closeSession(session);
1371            }
1372        }
1373
1374        return count.intValue();
1375    }
1376
1377    public int countByMx(String mx) throws SystemException {
1378        Object[] finderArgs = new Object[] { mx };
1379
1380        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_MX,
1381                finderArgs, this);
1382
1383        if (count == null) {
1384            Session session = null;
1385
1386            try {
1387                session = openSession();
1388
1389                StringBuilder query = new StringBuilder();
1390
1391                query.append("SELECT COUNT(company) ");
1392                query.append("FROM Company company WHERE ");
1393
1394                if (mx == null) {
1395                    query.append("company.mx IS NULL");
1396                }
1397                else {
1398                    query.append("company.mx = ?");
1399                }
1400
1401                query.append(" ");
1402
1403                Query q = session.createQuery(query.toString());
1404
1405                QueryPos qPos = QueryPos.getInstance(q);
1406
1407                if (mx != null) {
1408                    qPos.add(mx);
1409                }
1410
1411                count = (Long)q.uniqueResult();
1412            }
1413            catch (Exception e) {
1414                throw processException(e);
1415            }
1416            finally {
1417                if (count == null) {
1418                    count = Long.valueOf(0);
1419                }
1420
1421                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_MX, finderArgs,
1422                    count);
1423
1424                closeSession(session);
1425            }
1426        }
1427
1428        return count.intValue();
1429    }
1430
1431    public int countByLogoId(long logoId) throws SystemException {
1432        Object[] finderArgs = new Object[] { new Long(logoId) };
1433
1434        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_LOGOID,
1435                finderArgs, this);
1436
1437        if (count == null) {
1438            Session session = null;
1439
1440            try {
1441                session = openSession();
1442
1443                StringBuilder query = new StringBuilder();
1444
1445                query.append("SELECT COUNT(company) ");
1446                query.append("FROM Company company WHERE ");
1447
1448                query.append("company.logoId = ?");
1449
1450                query.append(" ");
1451
1452                Query q = session.createQuery(query.toString());
1453
1454                QueryPos qPos = QueryPos.getInstance(q);
1455
1456                qPos.add(logoId);
1457
1458                count = (Long)q.uniqueResult();
1459            }
1460            catch (Exception e) {
1461                throw processException(e);
1462            }
1463            finally {
1464                if (count == null) {
1465                    count = Long.valueOf(0);
1466                }
1467
1468                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_LOGOID,
1469                    finderArgs, count);
1470
1471                closeSession(session);
1472            }
1473        }
1474
1475        return count.intValue();
1476    }
1477
1478    public int countBySystem(boolean system) throws SystemException {
1479        Object[] finderArgs = new Object[] { Boolean.valueOf(system) };
1480
1481        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_SYSTEM,
1482                finderArgs, this);
1483
1484        if (count == null) {
1485            Session session = null;
1486
1487            try {
1488                session = openSession();
1489
1490                StringBuilder query = new StringBuilder();
1491
1492                query.append("SELECT COUNT(company) ");
1493                query.append("FROM Company company WHERE ");
1494
1495                query.append("company.system = ?");
1496
1497                query.append(" ");
1498
1499                Query q = session.createQuery(query.toString());
1500
1501                QueryPos qPos = QueryPos.getInstance(q);
1502
1503                qPos.add(system);
1504
1505                count = (Long)q.uniqueResult();
1506            }
1507            catch (Exception e) {
1508                throw processException(e);
1509            }
1510            finally {
1511                if (count == null) {
1512                    count = Long.valueOf(0);
1513                }
1514
1515                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SYSTEM,
1516                    finderArgs, count);
1517
1518                closeSession(session);
1519            }
1520        }
1521
1522        return count.intValue();
1523    }
1524
1525    public int countAll() throws SystemException {
1526        Object[] finderArgs = new Object[0];
1527
1528        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1529                finderArgs, this);
1530
1531        if (count == null) {
1532            Session session = null;
1533
1534            try {
1535                session = openSession();
1536
1537                Query q = session.createQuery(
1538                        "SELECT COUNT(company) FROM Company company");
1539
1540                count = (Long)q.uniqueResult();
1541            }
1542            catch (Exception e) {
1543                throw processException(e);
1544            }
1545            finally {
1546                if (count == null) {
1547                    count = Long.valueOf(0);
1548                }
1549
1550                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1551                    count);
1552
1553                closeSession(session);
1554            }
1555        }
1556
1557        return count.intValue();
1558    }
1559
1560    public void afterPropertiesSet() {
1561        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1562                    com.liferay.portal.util.PropsUtil.get(
1563                        "value.object.listener.com.liferay.portal.model.Company")));
1564
1565        if (listenerClassNames.length > 0) {
1566            try {
1567                List<ModelListener<Company>> listenersList = new ArrayList<ModelListener<Company>>();
1568
1569                for (String listenerClassName : listenerClassNames) {
1570                    listenersList.add((ModelListener<Company>)Class.forName(
1571                            listenerClassName).newInstance());
1572                }
1573
1574                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1575            }
1576            catch (Exception e) {
1577                _log.error(e);
1578            }
1579        }
1580    }
1581
1582    @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence.impl")
1583    protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
1584    @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence.impl")
1585    protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
1586    @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence.impl")
1587    protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
1588    @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence.impl")
1589    protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
1590    @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence.impl")
1591    protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
1592    @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence.impl")
1593    protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
1594    @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence.impl")
1595    protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
1596    @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence.impl")
1597    protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
1598    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence.impl")
1599    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
1600    @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence.impl")
1601    protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
1602    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence.impl")
1603    protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
1604    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence.impl")
1605    protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
1606    @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence.impl")
1607    protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
1608    @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence.impl")
1609    protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
1610    @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence.impl")
1611    protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
1612    @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence.impl")
1613    protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
1614    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence.impl")
1615    protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1616    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence.impl")
1617    protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
1618    @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence.impl")
1619    protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
1620    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence.impl")
1621    protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
1622    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence.impl")
1623    protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1624    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence.impl")
1625    protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
1626    @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence.impl")
1627    protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
1628    @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence.impl")
1629    protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
1630    @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence.impl")
1631    protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
1632    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence.impl")
1633    protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
1634    @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence.impl")
1635    protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
1636    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence.impl")
1637    protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
1638    @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence.impl")
1639    protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
1640    @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence.impl")
1641    protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
1642    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
1643    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
1644    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence.impl")
1645    protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
1646    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence.impl")
1647    protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
1648    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence.impl")
1649    protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
1650    @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence.impl")
1651    protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
1652    @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence.impl")
1653    protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
1654    @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence.impl")
1655    protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
1656    @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence.impl")
1657    protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
1658    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
1659    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
1660    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence.impl")
1661    protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
1662    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence.impl")
1663    protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
1664    @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence.impl")
1665    protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
1666    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence.impl")
1667    protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
1668    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence.impl")
1669    protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
1670    @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence.impl")
1671    protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
1672    @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence.impl")
1673    protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
1674    private static Log _log = LogFactoryUtil.getLog(CompanyPersistenceImpl.class);
1675}