001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
033    import com.liferay.portal.kernel.search.Indexable;
034    import com.liferay.portal.kernel.search.IndexableType;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    import com.liferay.portal.model.Company;
037    import com.liferay.portal.model.PersistedModel;
038    import com.liferay.portal.service.BaseLocalServiceImpl;
039    import com.liferay.portal.service.CompanyLocalService;
040    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
041    import com.liferay.portal.service.persistence.AccountPersistence;
042    import com.liferay.portal.service.persistence.CompanyPersistence;
043    import com.liferay.portal.service.persistence.ContactPersistence;
044    import com.liferay.portal.service.persistence.GroupFinder;
045    import com.liferay.portal.service.persistence.GroupPersistence;
046    import com.liferay.portal.service.persistence.ImagePersistence;
047    import com.liferay.portal.service.persistence.LayoutPrototypePersistence;
048    import com.liferay.portal.service.persistence.LayoutSetPersistence;
049    import com.liferay.portal.service.persistence.LayoutSetPrototypePersistence;
050    import com.liferay.portal.service.persistence.OrganizationFinder;
051    import com.liferay.portal.service.persistence.OrganizationPersistence;
052    import com.liferay.portal.service.persistence.PasswordPolicyFinder;
053    import com.liferay.portal.service.persistence.PasswordPolicyPersistence;
054    import com.liferay.portal.service.persistence.PortalPreferencesPersistence;
055    import com.liferay.portal.service.persistence.PortletPersistence;
056    import com.liferay.portal.service.persistence.ResourcePermissionFinder;
057    import com.liferay.portal.service.persistence.ResourcePermissionPersistence;
058    import com.liferay.portal.service.persistence.RoleFinder;
059    import com.liferay.portal.service.persistence.RolePersistence;
060    import com.liferay.portal.service.persistence.UserFinder;
061    import com.liferay.portal.service.persistence.UserPersistence;
062    import com.liferay.portal.service.persistence.VirtualHostPersistence;
063    import com.liferay.portal.util.PortalUtil;
064    
065    import java.io.Serializable;
066    
067    import java.util.List;
068    
069    import javax.sql.DataSource;
070    
071    /**
072     * Provides the base implementation for the company local service.
073     *
074     * <p>
075     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.CompanyLocalServiceImpl}.
076     * </p>
077     *
078     * @author Brian Wing Shun Chan
079     * @see com.liferay.portal.service.impl.CompanyLocalServiceImpl
080     * @see com.liferay.portal.service.CompanyLocalServiceUtil
081     * @generated
082     */
083    @ProviderType
084    public abstract class CompanyLocalServiceBaseImpl extends BaseLocalServiceImpl
085            implements CompanyLocalService, IdentifiableOSGiService {
086            /*
087             * NOTE FOR DEVELOPERS:
088             *
089             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.CompanyLocalServiceUtil} to access the company local service.
090             */
091    
092            /**
093             * Adds the company to the database. Also notifies the appropriate model listeners.
094             *
095             * @param company the company
096             * @return the company that was added
097             */
098            @Indexable(type = IndexableType.REINDEX)
099            @Override
100            public Company addCompany(Company company) {
101                    company.setNew(true);
102    
103                    return companyPersistence.update(company);
104            }
105    
106            /**
107             * Creates a new company with the primary key. Does not add the company to the database.
108             *
109             * @param companyId the primary key for the new company
110             * @return the new company
111             */
112            @Override
113            public Company createCompany(long companyId) {
114                    return companyPersistence.create(companyId);
115            }
116    
117            /**
118             * Deletes the company with the primary key from the database. Also notifies the appropriate model listeners.
119             *
120             * @param companyId the primary key of the company
121             * @return the company that was removed
122             * @throws PortalException if a company with the primary key could not be found
123             */
124            @Indexable(type = IndexableType.DELETE)
125            @Override
126            public Company deleteCompany(long companyId) throws PortalException {
127                    return companyPersistence.remove(companyId);
128            }
129    
130            /**
131             * Deletes the company from the database. Also notifies the appropriate model listeners.
132             *
133             * @param company the company
134             * @return the company that was removed
135             * @throws PortalException
136             */
137            @Indexable(type = IndexableType.DELETE)
138            @Override
139            public Company deleteCompany(Company company) throws PortalException {
140                    return companyPersistence.remove(company);
141            }
142    
143            @Override
144            public DynamicQuery dynamicQuery() {
145                    Class<?> clazz = getClass();
146    
147                    return DynamicQueryFactoryUtil.forClass(Company.class,
148                            clazz.getClassLoader());
149            }
150    
151            /**
152             * Performs a dynamic query on the database and returns the matching rows.
153             *
154             * @param dynamicQuery the dynamic query
155             * @return the matching rows
156             */
157            @Override
158            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
159                    return companyPersistence.findWithDynamicQuery(dynamicQuery);
160            }
161    
162            /**
163             * Performs a dynamic query on the database and returns a range of the matching rows.
164             *
165             * <p>
166             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
167             * </p>
168             *
169             * @param dynamicQuery the dynamic query
170             * @param start the lower bound of the range of model instances
171             * @param end the upper bound of the range of model instances (not inclusive)
172             * @return the range of matching rows
173             */
174            @Override
175            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
176                    int end) {
177                    return companyPersistence.findWithDynamicQuery(dynamicQuery, start, end);
178            }
179    
180            /**
181             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
182             *
183             * <p>
184             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
185             * </p>
186             *
187             * @param dynamicQuery the dynamic query
188             * @param start the lower bound of the range of model instances
189             * @param end the upper bound of the range of model instances (not inclusive)
190             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
191             * @return the ordered range of matching rows
192             */
193            @Override
194            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
195                    int end, OrderByComparator<T> orderByComparator) {
196                    return companyPersistence.findWithDynamicQuery(dynamicQuery, start,
197                            end, orderByComparator);
198            }
199    
200            /**
201             * Returns the number of rows matching the dynamic query.
202             *
203             * @param dynamicQuery the dynamic query
204             * @return the number of rows matching the dynamic query
205             */
206            @Override
207            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
208                    return companyPersistence.countWithDynamicQuery(dynamicQuery);
209            }
210    
211            /**
212             * Returns the number of rows matching the dynamic query.
213             *
214             * @param dynamicQuery the dynamic query
215             * @param projection the projection to apply to the query
216             * @return the number of rows matching the dynamic query
217             */
218            @Override
219            public long dynamicQueryCount(DynamicQuery dynamicQuery,
220                    Projection projection) {
221                    return companyPersistence.countWithDynamicQuery(dynamicQuery, projection);
222            }
223    
224            @Override
225            public Company fetchCompany(long companyId) {
226                    return companyPersistence.fetchByPrimaryKey(companyId);
227            }
228    
229            /**
230             * Returns the company with the primary key.
231             *
232             * @param companyId the primary key of the company
233             * @return the company
234             * @throws PortalException if a company with the primary key could not be found
235             */
236            @Override
237            public Company getCompany(long companyId) throws PortalException {
238                    return companyPersistence.findByPrimaryKey(companyId);
239            }
240    
241            @Override
242            public ActionableDynamicQuery getActionableDynamicQuery() {
243                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
244    
245                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.CompanyLocalServiceUtil.getService());
246                    actionableDynamicQuery.setClassLoader(getClassLoader());
247                    actionableDynamicQuery.setModelClass(Company.class);
248    
249                    actionableDynamicQuery.setPrimaryKeyPropertyName("companyId");
250    
251                    return actionableDynamicQuery;
252            }
253    
254            @Override
255            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
256                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
257    
258                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.CompanyLocalServiceUtil.getService());
259                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
260                    indexableActionableDynamicQuery.setModelClass(Company.class);
261    
262                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("companyId");
263    
264                    return indexableActionableDynamicQuery;
265            }
266    
267            protected void initActionableDynamicQuery(
268                    ActionableDynamicQuery actionableDynamicQuery) {
269                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.CompanyLocalServiceUtil.getService());
270                    actionableDynamicQuery.setClassLoader(getClassLoader());
271                    actionableDynamicQuery.setModelClass(Company.class);
272    
273                    actionableDynamicQuery.setPrimaryKeyPropertyName("companyId");
274            }
275    
276            /**
277             * @throws PortalException
278             */
279            @Override
280            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
281                    throws PortalException {
282                    return companyLocalService.deleteCompany((Company)persistedModel);
283            }
284    
285            @Override
286            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
287                    throws PortalException {
288                    return companyPersistence.findByPrimaryKey(primaryKeyObj);
289            }
290    
291            /**
292             * Returns a range of all the companies.
293             *
294             * <p>
295             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
296             * </p>
297             *
298             * @param start the lower bound of the range of companies
299             * @param end the upper bound of the range of companies (not inclusive)
300             * @return the range of companies
301             */
302            @Override
303            public List<Company> getCompanies(int start, int end) {
304                    return companyPersistence.findAll(start, end);
305            }
306    
307            /**
308             * Returns the number of companies.
309             *
310             * @return the number of companies
311             */
312            @Override
313            public int getCompaniesCount() {
314                    return companyPersistence.countAll();
315            }
316    
317            /**
318             * Updates the company in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
319             *
320             * @param company the company
321             * @return the company that was updated
322             */
323            @Indexable(type = IndexableType.REINDEX)
324            @Override
325            public Company updateCompany(Company company) {
326                    return companyPersistence.update(company);
327            }
328    
329            /**
330             * Returns the company local service.
331             *
332             * @return the company local service
333             */
334            public CompanyLocalService getCompanyLocalService() {
335                    return companyLocalService;
336            }
337    
338            /**
339             * Sets the company local service.
340             *
341             * @param companyLocalService the company local service
342             */
343            public void setCompanyLocalService(CompanyLocalService companyLocalService) {
344                    this.companyLocalService = companyLocalService;
345            }
346    
347            /**
348             * Returns the company persistence.
349             *
350             * @return the company persistence
351             */
352            public CompanyPersistence getCompanyPersistence() {
353                    return companyPersistence;
354            }
355    
356            /**
357             * Sets the company persistence.
358             *
359             * @param companyPersistence the company persistence
360             */
361            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
362                    this.companyPersistence = companyPersistence;
363            }
364    
365            /**
366             * Returns the counter local service.
367             *
368             * @return the counter local service
369             */
370            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
371                    return counterLocalService;
372            }
373    
374            /**
375             * Sets the counter local service.
376             *
377             * @param counterLocalService the counter local service
378             */
379            public void setCounterLocalService(
380                    com.liferay.counter.service.CounterLocalService counterLocalService) {
381                    this.counterLocalService = counterLocalService;
382            }
383    
384            /**
385             * Returns the account local service.
386             *
387             * @return the account local service
388             */
389            public com.liferay.portal.service.AccountLocalService getAccountLocalService() {
390                    return accountLocalService;
391            }
392    
393            /**
394             * Sets the account local service.
395             *
396             * @param accountLocalService the account local service
397             */
398            public void setAccountLocalService(
399                    com.liferay.portal.service.AccountLocalService accountLocalService) {
400                    this.accountLocalService = accountLocalService;
401            }
402    
403            /**
404             * Returns the account persistence.
405             *
406             * @return the account persistence
407             */
408            public AccountPersistence getAccountPersistence() {
409                    return accountPersistence;
410            }
411    
412            /**
413             * Sets the account persistence.
414             *
415             * @param accountPersistence the account persistence
416             */
417            public void setAccountPersistence(AccountPersistence accountPersistence) {
418                    this.accountPersistence = accountPersistence;
419            }
420    
421            /**
422             * Returns the contact local service.
423             *
424             * @return the contact local service
425             */
426            public com.liferay.portal.service.ContactLocalService getContactLocalService() {
427                    return contactLocalService;
428            }
429    
430            /**
431             * Sets the contact local service.
432             *
433             * @param contactLocalService the contact local service
434             */
435            public void setContactLocalService(
436                    com.liferay.portal.service.ContactLocalService contactLocalService) {
437                    this.contactLocalService = contactLocalService;
438            }
439    
440            /**
441             * Returns the contact persistence.
442             *
443             * @return the contact persistence
444             */
445            public ContactPersistence getContactPersistence() {
446                    return contactPersistence;
447            }
448    
449            /**
450             * Sets the contact persistence.
451             *
452             * @param contactPersistence the contact persistence
453             */
454            public void setContactPersistence(ContactPersistence contactPersistence) {
455                    this.contactPersistence = contactPersistence;
456            }
457    
458            /**
459             * Returns the group local service.
460             *
461             * @return the group local service
462             */
463            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
464                    return groupLocalService;
465            }
466    
467            /**
468             * Sets the group local service.
469             *
470             * @param groupLocalService the group local service
471             */
472            public void setGroupLocalService(
473                    com.liferay.portal.service.GroupLocalService groupLocalService) {
474                    this.groupLocalService = groupLocalService;
475            }
476    
477            /**
478             * Returns the group persistence.
479             *
480             * @return the group persistence
481             */
482            public GroupPersistence getGroupPersistence() {
483                    return groupPersistence;
484            }
485    
486            /**
487             * Sets the group persistence.
488             *
489             * @param groupPersistence the group persistence
490             */
491            public void setGroupPersistence(GroupPersistence groupPersistence) {
492                    this.groupPersistence = groupPersistence;
493            }
494    
495            /**
496             * Returns the group finder.
497             *
498             * @return the group finder
499             */
500            public GroupFinder getGroupFinder() {
501                    return groupFinder;
502            }
503    
504            /**
505             * Sets the group finder.
506             *
507             * @param groupFinder the group finder
508             */
509            public void setGroupFinder(GroupFinder groupFinder) {
510                    this.groupFinder = groupFinder;
511            }
512    
513            /**
514             * Returns the image local service.
515             *
516             * @return the image local service
517             */
518            public com.liferay.portal.service.ImageLocalService getImageLocalService() {
519                    return imageLocalService;
520            }
521    
522            /**
523             * Sets the image local service.
524             *
525             * @param imageLocalService the image local service
526             */
527            public void setImageLocalService(
528                    com.liferay.portal.service.ImageLocalService imageLocalService) {
529                    this.imageLocalService = imageLocalService;
530            }
531    
532            /**
533             * Returns the image persistence.
534             *
535             * @return the image persistence
536             */
537            public ImagePersistence getImagePersistence() {
538                    return imagePersistence;
539            }
540    
541            /**
542             * Sets the image persistence.
543             *
544             * @param imagePersistence the image persistence
545             */
546            public void setImagePersistence(ImagePersistence imagePersistence) {
547                    this.imagePersistence = imagePersistence;
548            }
549    
550            /**
551             * Returns the layout prototype local service.
552             *
553             * @return the layout prototype local service
554             */
555            public com.liferay.portal.service.LayoutPrototypeLocalService getLayoutPrototypeLocalService() {
556                    return layoutPrototypeLocalService;
557            }
558    
559            /**
560             * Sets the layout prototype local service.
561             *
562             * @param layoutPrototypeLocalService the layout prototype local service
563             */
564            public void setLayoutPrototypeLocalService(
565                    com.liferay.portal.service.LayoutPrototypeLocalService layoutPrototypeLocalService) {
566                    this.layoutPrototypeLocalService = layoutPrototypeLocalService;
567            }
568    
569            /**
570             * Returns the layout prototype persistence.
571             *
572             * @return the layout prototype persistence
573             */
574            public LayoutPrototypePersistence getLayoutPrototypePersistence() {
575                    return layoutPrototypePersistence;
576            }
577    
578            /**
579             * Sets the layout prototype persistence.
580             *
581             * @param layoutPrototypePersistence the layout prototype persistence
582             */
583            public void setLayoutPrototypePersistence(
584                    LayoutPrototypePersistence layoutPrototypePersistence) {
585                    this.layoutPrototypePersistence = layoutPrototypePersistence;
586            }
587    
588            /**
589             * Returns the layout set local service.
590             *
591             * @return the layout set local service
592             */
593            public com.liferay.portal.service.LayoutSetLocalService getLayoutSetLocalService() {
594                    return layoutSetLocalService;
595            }
596    
597            /**
598             * Sets the layout set local service.
599             *
600             * @param layoutSetLocalService the layout set local service
601             */
602            public void setLayoutSetLocalService(
603                    com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService) {
604                    this.layoutSetLocalService = layoutSetLocalService;
605            }
606    
607            /**
608             * Returns the layout set persistence.
609             *
610             * @return the layout set persistence
611             */
612            public LayoutSetPersistence getLayoutSetPersistence() {
613                    return layoutSetPersistence;
614            }
615    
616            /**
617             * Sets the layout set persistence.
618             *
619             * @param layoutSetPersistence the layout set persistence
620             */
621            public void setLayoutSetPersistence(
622                    LayoutSetPersistence layoutSetPersistence) {
623                    this.layoutSetPersistence = layoutSetPersistence;
624            }
625    
626            /**
627             * Returns the layout set prototype local service.
628             *
629             * @return the layout set prototype local service
630             */
631            public com.liferay.portal.service.LayoutSetPrototypeLocalService getLayoutSetPrototypeLocalService() {
632                    return layoutSetPrototypeLocalService;
633            }
634    
635            /**
636             * Sets the layout set prototype local service.
637             *
638             * @param layoutSetPrototypeLocalService the layout set prototype local service
639             */
640            public void setLayoutSetPrototypeLocalService(
641                    com.liferay.portal.service.LayoutSetPrototypeLocalService layoutSetPrototypeLocalService) {
642                    this.layoutSetPrototypeLocalService = layoutSetPrototypeLocalService;
643            }
644    
645            /**
646             * Returns the layout set prototype persistence.
647             *
648             * @return the layout set prototype persistence
649             */
650            public LayoutSetPrototypePersistence getLayoutSetPrototypePersistence() {
651                    return layoutSetPrototypePersistence;
652            }
653    
654            /**
655             * Sets the layout set prototype persistence.
656             *
657             * @param layoutSetPrototypePersistence the layout set prototype persistence
658             */
659            public void setLayoutSetPrototypePersistence(
660                    LayoutSetPrototypePersistence layoutSetPrototypePersistence) {
661                    this.layoutSetPrototypePersistence = layoutSetPrototypePersistence;
662            }
663    
664            /**
665             * Returns the organization local service.
666             *
667             * @return the organization local service
668             */
669            public com.liferay.portal.service.OrganizationLocalService getOrganizationLocalService() {
670                    return organizationLocalService;
671            }
672    
673            /**
674             * Sets the organization local service.
675             *
676             * @param organizationLocalService the organization local service
677             */
678            public void setOrganizationLocalService(
679                    com.liferay.portal.service.OrganizationLocalService organizationLocalService) {
680                    this.organizationLocalService = organizationLocalService;
681            }
682    
683            /**
684             * Returns the organization persistence.
685             *
686             * @return the organization persistence
687             */
688            public OrganizationPersistence getOrganizationPersistence() {
689                    return organizationPersistence;
690            }
691    
692            /**
693             * Sets the organization persistence.
694             *
695             * @param organizationPersistence the organization persistence
696             */
697            public void setOrganizationPersistence(
698                    OrganizationPersistence organizationPersistence) {
699                    this.organizationPersistence = organizationPersistence;
700            }
701    
702            /**
703             * Returns the organization finder.
704             *
705             * @return the organization finder
706             */
707            public OrganizationFinder getOrganizationFinder() {
708                    return organizationFinder;
709            }
710    
711            /**
712             * Sets the organization finder.
713             *
714             * @param organizationFinder the organization finder
715             */
716            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
717                    this.organizationFinder = organizationFinder;
718            }
719    
720            /**
721             * Returns the password policy local service.
722             *
723             * @return the password policy local service
724             */
725            public com.liferay.portal.service.PasswordPolicyLocalService getPasswordPolicyLocalService() {
726                    return passwordPolicyLocalService;
727            }
728    
729            /**
730             * Sets the password policy local service.
731             *
732             * @param passwordPolicyLocalService the password policy local service
733             */
734            public void setPasswordPolicyLocalService(
735                    com.liferay.portal.service.PasswordPolicyLocalService passwordPolicyLocalService) {
736                    this.passwordPolicyLocalService = passwordPolicyLocalService;
737            }
738    
739            /**
740             * Returns the password policy persistence.
741             *
742             * @return the password policy persistence
743             */
744            public PasswordPolicyPersistence getPasswordPolicyPersistence() {
745                    return passwordPolicyPersistence;
746            }
747    
748            /**
749             * Sets the password policy persistence.
750             *
751             * @param passwordPolicyPersistence the password policy persistence
752             */
753            public void setPasswordPolicyPersistence(
754                    PasswordPolicyPersistence passwordPolicyPersistence) {
755                    this.passwordPolicyPersistence = passwordPolicyPersistence;
756            }
757    
758            /**
759             * Returns the password policy finder.
760             *
761             * @return the password policy finder
762             */
763            public PasswordPolicyFinder getPasswordPolicyFinder() {
764                    return passwordPolicyFinder;
765            }
766    
767            /**
768             * Sets the password policy finder.
769             *
770             * @param passwordPolicyFinder the password policy finder
771             */
772            public void setPasswordPolicyFinder(
773                    PasswordPolicyFinder passwordPolicyFinder) {
774                    this.passwordPolicyFinder = passwordPolicyFinder;
775            }
776    
777            /**
778             * Returns the portal preferences local service.
779             *
780             * @return the portal preferences local service
781             */
782            public com.liferay.portal.service.PortalPreferencesLocalService getPortalPreferencesLocalService() {
783                    return portalPreferencesLocalService;
784            }
785    
786            /**
787             * Sets the portal preferences local service.
788             *
789             * @param portalPreferencesLocalService the portal preferences local service
790             */
791            public void setPortalPreferencesLocalService(
792                    com.liferay.portal.service.PortalPreferencesLocalService portalPreferencesLocalService) {
793                    this.portalPreferencesLocalService = portalPreferencesLocalService;
794            }
795    
796            /**
797             * Returns the portal preferences persistence.
798             *
799             * @return the portal preferences persistence
800             */
801            public PortalPreferencesPersistence getPortalPreferencesPersistence() {
802                    return portalPreferencesPersistence;
803            }
804    
805            /**
806             * Sets the portal preferences persistence.
807             *
808             * @param portalPreferencesPersistence the portal preferences persistence
809             */
810            public void setPortalPreferencesPersistence(
811                    PortalPreferencesPersistence portalPreferencesPersistence) {
812                    this.portalPreferencesPersistence = portalPreferencesPersistence;
813            }
814    
815            /**
816             * Returns the portlet local service.
817             *
818             * @return the portlet local service
819             */
820            public com.liferay.portal.service.PortletLocalService getPortletLocalService() {
821                    return portletLocalService;
822            }
823    
824            /**
825             * Sets the portlet local service.
826             *
827             * @param portletLocalService the portlet local service
828             */
829            public void setPortletLocalService(
830                    com.liferay.portal.service.PortletLocalService portletLocalService) {
831                    this.portletLocalService = portletLocalService;
832            }
833    
834            /**
835             * Returns the portlet persistence.
836             *
837             * @return the portlet persistence
838             */
839            public PortletPersistence getPortletPersistence() {
840                    return portletPersistence;
841            }
842    
843            /**
844             * Sets the portlet persistence.
845             *
846             * @param portletPersistence the portlet persistence
847             */
848            public void setPortletPersistence(PortletPersistence portletPersistence) {
849                    this.portletPersistence = portletPersistence;
850            }
851    
852            /**
853             * Returns the resource local service.
854             *
855             * @return the resource local service
856             */
857            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
858                    return resourceLocalService;
859            }
860    
861            /**
862             * Sets the resource local service.
863             *
864             * @param resourceLocalService the resource local service
865             */
866            public void setResourceLocalService(
867                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
868                    this.resourceLocalService = resourceLocalService;
869            }
870    
871            /**
872             * Returns the resource permission local service.
873             *
874             * @return the resource permission local service
875             */
876            public com.liferay.portal.service.ResourcePermissionLocalService getResourcePermissionLocalService() {
877                    return resourcePermissionLocalService;
878            }
879    
880            /**
881             * Sets the resource permission local service.
882             *
883             * @param resourcePermissionLocalService the resource permission local service
884             */
885            public void setResourcePermissionLocalService(
886                    com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService) {
887                    this.resourcePermissionLocalService = resourcePermissionLocalService;
888            }
889    
890            /**
891             * Returns the resource permission persistence.
892             *
893             * @return the resource permission persistence
894             */
895            public ResourcePermissionPersistence getResourcePermissionPersistence() {
896                    return resourcePermissionPersistence;
897            }
898    
899            /**
900             * Sets the resource permission persistence.
901             *
902             * @param resourcePermissionPersistence the resource permission persistence
903             */
904            public void setResourcePermissionPersistence(
905                    ResourcePermissionPersistence resourcePermissionPersistence) {
906                    this.resourcePermissionPersistence = resourcePermissionPersistence;
907            }
908    
909            /**
910             * Returns the resource permission finder.
911             *
912             * @return the resource permission finder
913             */
914            public ResourcePermissionFinder getResourcePermissionFinder() {
915                    return resourcePermissionFinder;
916            }
917    
918            /**
919             * Sets the resource permission finder.
920             *
921             * @param resourcePermissionFinder the resource permission finder
922             */
923            public void setResourcePermissionFinder(
924                    ResourcePermissionFinder resourcePermissionFinder) {
925                    this.resourcePermissionFinder = resourcePermissionFinder;
926            }
927    
928            /**
929             * Returns the role local service.
930             *
931             * @return the role local service
932             */
933            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
934                    return roleLocalService;
935            }
936    
937            /**
938             * Sets the role local service.
939             *
940             * @param roleLocalService the role local service
941             */
942            public void setRoleLocalService(
943                    com.liferay.portal.service.RoleLocalService roleLocalService) {
944                    this.roleLocalService = roleLocalService;
945            }
946    
947            /**
948             * Returns the role persistence.
949             *
950             * @return the role persistence
951             */
952            public RolePersistence getRolePersistence() {
953                    return rolePersistence;
954            }
955    
956            /**
957             * Sets the role persistence.
958             *
959             * @param rolePersistence the role persistence
960             */
961            public void setRolePersistence(RolePersistence rolePersistence) {
962                    this.rolePersistence = rolePersistence;
963            }
964    
965            /**
966             * Returns the role finder.
967             *
968             * @return the role finder
969             */
970            public RoleFinder getRoleFinder() {
971                    return roleFinder;
972            }
973    
974            /**
975             * Sets the role finder.
976             *
977             * @param roleFinder the role finder
978             */
979            public void setRoleFinder(RoleFinder roleFinder) {
980                    this.roleFinder = roleFinder;
981            }
982    
983            /**
984             * Returns the user local service.
985             *
986             * @return the user local service
987             */
988            public com.liferay.portal.service.UserLocalService getUserLocalService() {
989                    return userLocalService;
990            }
991    
992            /**
993             * Sets the user local service.
994             *
995             * @param userLocalService the user local service
996             */
997            public void setUserLocalService(
998                    com.liferay.portal.service.UserLocalService userLocalService) {
999                    this.userLocalService = userLocalService;
1000            }
1001    
1002            /**
1003             * Returns the user persistence.
1004             *
1005             * @return the user persistence
1006             */
1007            public UserPersistence getUserPersistence() {
1008                    return userPersistence;
1009            }
1010    
1011            /**
1012             * Sets the user persistence.
1013             *
1014             * @param userPersistence the user persistence
1015             */
1016            public void setUserPersistence(UserPersistence userPersistence) {
1017                    this.userPersistence = userPersistence;
1018            }
1019    
1020            /**
1021             * Returns the user finder.
1022             *
1023             * @return the user finder
1024             */
1025            public UserFinder getUserFinder() {
1026                    return userFinder;
1027            }
1028    
1029            /**
1030             * Sets the user finder.
1031             *
1032             * @param userFinder the user finder
1033             */
1034            public void setUserFinder(UserFinder userFinder) {
1035                    this.userFinder = userFinder;
1036            }
1037    
1038            /**
1039             * Returns the virtual host local service.
1040             *
1041             * @return the virtual host local service
1042             */
1043            public com.liferay.portal.service.VirtualHostLocalService getVirtualHostLocalService() {
1044                    return virtualHostLocalService;
1045            }
1046    
1047            /**
1048             * Sets the virtual host local service.
1049             *
1050             * @param virtualHostLocalService the virtual host local service
1051             */
1052            public void setVirtualHostLocalService(
1053                    com.liferay.portal.service.VirtualHostLocalService virtualHostLocalService) {
1054                    this.virtualHostLocalService = virtualHostLocalService;
1055            }
1056    
1057            /**
1058             * Returns the virtual host persistence.
1059             *
1060             * @return the virtual host persistence
1061             */
1062            public VirtualHostPersistence getVirtualHostPersistence() {
1063                    return virtualHostPersistence;
1064            }
1065    
1066            /**
1067             * Sets the virtual host persistence.
1068             *
1069             * @param virtualHostPersistence the virtual host persistence
1070             */
1071            public void setVirtualHostPersistence(
1072                    VirtualHostPersistence virtualHostPersistence) {
1073                    this.virtualHostPersistence = virtualHostPersistence;
1074            }
1075    
1076            public void afterPropertiesSet() {
1077                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Company",
1078                            companyLocalService);
1079            }
1080    
1081            public void destroy() {
1082                    persistedModelLocalServiceRegistry.unregister(
1083                            "com.liferay.portal.model.Company");
1084            }
1085    
1086            /**
1087             * Returns the OSGi service identifier.
1088             *
1089             * @return the OSGi service identifier
1090             */
1091            @Override
1092            public String getOSGiServiceIdentifier() {
1093                    return CompanyLocalService.class.getName();
1094            }
1095    
1096            protected Class<?> getModelClass() {
1097                    return Company.class;
1098            }
1099    
1100            protected String getModelClassName() {
1101                    return Company.class.getName();
1102            }
1103    
1104            /**
1105             * Performs a SQL query.
1106             *
1107             * @param sql the sql query
1108             */
1109            protected void runSQL(String sql) {
1110                    try {
1111                            DataSource dataSource = companyPersistence.getDataSource();
1112    
1113                            DB db = DBManagerUtil.getDB();
1114    
1115                            sql = db.buildSQL(sql);
1116                            sql = PortalUtil.transformSQL(sql);
1117    
1118                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1119                                            sql, new int[0]);
1120    
1121                            sqlUpdate.update();
1122                    }
1123                    catch (Exception e) {
1124                            throw new SystemException(e);
1125                    }
1126            }
1127    
1128            @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
1129            protected CompanyLocalService companyLocalService;
1130            @BeanReference(type = CompanyPersistence.class)
1131            protected CompanyPersistence companyPersistence;
1132            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1133            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1134            @BeanReference(type = com.liferay.portal.service.AccountLocalService.class)
1135            protected com.liferay.portal.service.AccountLocalService accountLocalService;
1136            @BeanReference(type = AccountPersistence.class)
1137            protected AccountPersistence accountPersistence;
1138            @BeanReference(type = com.liferay.portal.service.ContactLocalService.class)
1139            protected com.liferay.portal.service.ContactLocalService contactLocalService;
1140            @BeanReference(type = ContactPersistence.class)
1141            protected ContactPersistence contactPersistence;
1142            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1143            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1144            @BeanReference(type = GroupPersistence.class)
1145            protected GroupPersistence groupPersistence;
1146            @BeanReference(type = GroupFinder.class)
1147            protected GroupFinder groupFinder;
1148            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
1149            protected com.liferay.portal.service.ImageLocalService imageLocalService;
1150            @BeanReference(type = ImagePersistence.class)
1151            protected ImagePersistence imagePersistence;
1152            @BeanReference(type = com.liferay.portal.service.LayoutPrototypeLocalService.class)
1153            protected com.liferay.portal.service.LayoutPrototypeLocalService layoutPrototypeLocalService;
1154            @BeanReference(type = LayoutPrototypePersistence.class)
1155            protected LayoutPrototypePersistence layoutPrototypePersistence;
1156            @BeanReference(type = com.liferay.portal.service.LayoutSetLocalService.class)
1157            protected com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService;
1158            @BeanReference(type = LayoutSetPersistence.class)
1159            protected LayoutSetPersistence layoutSetPersistence;
1160            @BeanReference(type = com.liferay.portal.service.LayoutSetPrototypeLocalService.class)
1161            protected com.liferay.portal.service.LayoutSetPrototypeLocalService layoutSetPrototypeLocalService;
1162            @BeanReference(type = LayoutSetPrototypePersistence.class)
1163            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1164            @BeanReference(type = com.liferay.portal.service.OrganizationLocalService.class)
1165            protected com.liferay.portal.service.OrganizationLocalService organizationLocalService;
1166            @BeanReference(type = OrganizationPersistence.class)
1167            protected OrganizationPersistence organizationPersistence;
1168            @BeanReference(type = OrganizationFinder.class)
1169            protected OrganizationFinder organizationFinder;
1170            @BeanReference(type = com.liferay.portal.service.PasswordPolicyLocalService.class)
1171            protected com.liferay.portal.service.PasswordPolicyLocalService passwordPolicyLocalService;
1172            @BeanReference(type = PasswordPolicyPersistence.class)
1173            protected PasswordPolicyPersistence passwordPolicyPersistence;
1174            @BeanReference(type = PasswordPolicyFinder.class)
1175            protected PasswordPolicyFinder passwordPolicyFinder;
1176            @BeanReference(type = com.liferay.portal.service.PortalPreferencesLocalService.class)
1177            protected com.liferay.portal.service.PortalPreferencesLocalService portalPreferencesLocalService;
1178            @BeanReference(type = PortalPreferencesPersistence.class)
1179            protected PortalPreferencesPersistence portalPreferencesPersistence;
1180            @BeanReference(type = com.liferay.portal.service.PortletLocalService.class)
1181            protected com.liferay.portal.service.PortletLocalService portletLocalService;
1182            @BeanReference(type = PortletPersistence.class)
1183            protected PortletPersistence portletPersistence;
1184            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1185            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1186            @BeanReference(type = com.liferay.portal.service.ResourcePermissionLocalService.class)
1187            protected com.liferay.portal.service.ResourcePermissionLocalService resourcePermissionLocalService;
1188            @BeanReference(type = ResourcePermissionPersistence.class)
1189            protected ResourcePermissionPersistence resourcePermissionPersistence;
1190            @BeanReference(type = ResourcePermissionFinder.class)
1191            protected ResourcePermissionFinder resourcePermissionFinder;
1192            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
1193            protected com.liferay.portal.service.RoleLocalService roleLocalService;
1194            @BeanReference(type = RolePersistence.class)
1195            protected RolePersistence rolePersistence;
1196            @BeanReference(type = RoleFinder.class)
1197            protected RoleFinder roleFinder;
1198            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1199            protected com.liferay.portal.service.UserLocalService userLocalService;
1200            @BeanReference(type = UserPersistence.class)
1201            protected UserPersistence userPersistence;
1202            @BeanReference(type = UserFinder.class)
1203            protected UserFinder userFinder;
1204            @BeanReference(type = com.liferay.portal.service.VirtualHostLocalService.class)
1205            protected com.liferay.portal.service.VirtualHostLocalService virtualHostLocalService;
1206            @BeanReference(type = VirtualHostPersistence.class)
1207            protected VirtualHostPersistence virtualHostPersistence;
1208            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1209            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1210    }