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