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