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.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
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.search.Indexable;
033    import com.liferay.portal.kernel.search.IndexableType;
034    import com.liferay.portal.kernel.util.OrderByComparator;
035    import com.liferay.portal.model.Contact;
036    import com.liferay.portal.model.PersistedModel;
037    import com.liferay.portal.service.BaseLocalServiceImpl;
038    import com.liferay.portal.service.ContactLocalService;
039    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040    import com.liferay.portal.service.persistence.AddressPersistence;
041    import com.liferay.portal.service.persistence.ContactPersistence;
042    import com.liferay.portal.service.persistence.EmailAddressPersistence;
043    import com.liferay.portal.service.persistence.OrganizationFinder;
044    import com.liferay.portal.service.persistence.OrganizationPersistence;
045    import com.liferay.portal.service.persistence.PhonePersistence;
046    import com.liferay.portal.service.persistence.UserFinder;
047    import com.liferay.portal.service.persistence.UserPersistence;
048    import com.liferay.portal.service.persistence.WebsitePersistence;
049    import com.liferay.portal.util.PortalUtil;
050    
051    import java.io.Serializable;
052    
053    import java.util.List;
054    
055    import javax.sql.DataSource;
056    
057    /**
058     * Provides the base implementation for the contact local service.
059     *
060     * <p>
061     * 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.ContactLocalServiceImpl}.
062     * </p>
063     *
064     * @author Brian Wing Shun Chan
065     * @see com.liferay.portal.service.impl.ContactLocalServiceImpl
066     * @see com.liferay.portal.service.ContactLocalServiceUtil
067     * @generated
068     */
069    @ProviderType
070    public abstract class ContactLocalServiceBaseImpl extends BaseLocalServiceImpl
071            implements ContactLocalService, IdentifiableBean {
072            /*
073             * NOTE FOR DEVELOPERS:
074             *
075             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ContactLocalServiceUtil} to access the contact local service.
076             */
077    
078            /**
079             * Adds the contact to the database. Also notifies the appropriate model listeners.
080             *
081             * @param contact the contact
082             * @return the contact that was added
083             */
084            @Indexable(type = IndexableType.REINDEX)
085            @Override
086            public Contact addContact(Contact contact) {
087                    contact.setNew(true);
088    
089                    return contactPersistence.update(contact);
090            }
091    
092            /**
093             * Creates a new contact with the primary key. Does not add the contact to the database.
094             *
095             * @param contactId the primary key for the new contact
096             * @return the new contact
097             */
098            @Override
099            public Contact createContact(long contactId) {
100                    return contactPersistence.create(contactId);
101            }
102    
103            /**
104             * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners.
105             *
106             * @param contactId the primary key of the contact
107             * @return the contact that was removed
108             * @throws PortalException if a contact with the primary key could not be found
109             */
110            @Indexable(type = IndexableType.DELETE)
111            @Override
112            public Contact deleteContact(long contactId) throws PortalException {
113                    return contactPersistence.remove(contactId);
114            }
115    
116            /**
117             * Deletes the contact from the database. Also notifies the appropriate model listeners.
118             *
119             * @param contact the contact
120             * @return the contact that was removed
121             */
122            @Indexable(type = IndexableType.DELETE)
123            @Override
124            public Contact deleteContact(Contact contact) {
125                    return contactPersistence.remove(contact);
126            }
127    
128            @Override
129            public DynamicQuery dynamicQuery() {
130                    Class<?> clazz = getClass();
131    
132                    return DynamicQueryFactoryUtil.forClass(Contact.class,
133                            clazz.getClassLoader());
134            }
135    
136            /**
137             * Performs a dynamic query on the database and returns the matching rows.
138             *
139             * @param dynamicQuery the dynamic query
140             * @return the matching rows
141             */
142            @Override
143            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
144                    return contactPersistence.findWithDynamicQuery(dynamicQuery);
145            }
146    
147            /**
148             * Performs a dynamic query on the database and returns a range of the matching rows.
149             *
150             * <p>
151             * 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.ContactModelImpl}. 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.
152             * </p>
153             *
154             * @param dynamicQuery the dynamic query
155             * @param start the lower bound of the range of model instances
156             * @param end the upper bound of the range of model instances (not inclusive)
157             * @return the range of matching rows
158             */
159            @Override
160            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
161                    int end) {
162                    return contactPersistence.findWithDynamicQuery(dynamicQuery, start, end);
163            }
164    
165            /**
166             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
167             *
168             * <p>
169             * 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.ContactModelImpl}. 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.
170             * </p>
171             *
172             * @param dynamicQuery the dynamic query
173             * @param start the lower bound of the range of model instances
174             * @param end the upper bound of the range of model instances (not inclusive)
175             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
176             * @return the ordered range of matching rows
177             */
178            @Override
179            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
180                    int end, OrderByComparator<T> orderByComparator) {
181                    return contactPersistence.findWithDynamicQuery(dynamicQuery, start,
182                            end, orderByComparator);
183            }
184    
185            /**
186             * Returns the number of rows matching the dynamic query.
187             *
188             * @param dynamicQuery the dynamic query
189             * @return the number of rows matching the dynamic query
190             */
191            @Override
192            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
193                    return contactPersistence.countWithDynamicQuery(dynamicQuery);
194            }
195    
196            /**
197             * Returns the number of rows matching the dynamic query.
198             *
199             * @param dynamicQuery the dynamic query
200             * @param projection the projection to apply to the query
201             * @return the number of rows matching the dynamic query
202             */
203            @Override
204            public long dynamicQueryCount(DynamicQuery dynamicQuery,
205                    Projection projection) {
206                    return contactPersistence.countWithDynamicQuery(dynamicQuery, projection);
207            }
208    
209            @Override
210            public Contact fetchContact(long contactId) {
211                    return contactPersistence.fetchByPrimaryKey(contactId);
212            }
213    
214            /**
215             * Returns the contact with the primary key.
216             *
217             * @param contactId the primary key of the contact
218             * @return the contact
219             * @throws PortalException if a contact with the primary key could not be found
220             */
221            @Override
222            public Contact getContact(long contactId) throws PortalException {
223                    return contactPersistence.findByPrimaryKey(contactId);
224            }
225    
226            @Override
227            public ActionableDynamicQuery getActionableDynamicQuery() {
228                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
229    
230                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.ContactLocalServiceUtil.getService());
231                    actionableDynamicQuery.setClass(Contact.class);
232                    actionableDynamicQuery.setClassLoader(getClassLoader());
233    
234                    actionableDynamicQuery.setPrimaryKeyPropertyName("contactId");
235    
236                    return actionableDynamicQuery;
237            }
238    
239            protected void initActionableDynamicQuery(
240                    ActionableDynamicQuery actionableDynamicQuery) {
241                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.ContactLocalServiceUtil.getService());
242                    actionableDynamicQuery.setClass(Contact.class);
243                    actionableDynamicQuery.setClassLoader(getClassLoader());
244    
245                    actionableDynamicQuery.setPrimaryKeyPropertyName("contactId");
246            }
247    
248            /**
249             * @throws PortalException
250             */
251            @Override
252            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
253                    throws PortalException {
254                    return contactLocalService.deleteContact((Contact)persistedModel);
255            }
256    
257            @Override
258            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
259                    throws PortalException {
260                    return contactPersistence.findByPrimaryKey(primaryKeyObj);
261            }
262    
263            /**
264             * Returns a range of all the contacts.
265             *
266             * <p>
267             * 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.ContactModelImpl}. 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.
268             * </p>
269             *
270             * @param start the lower bound of the range of contacts
271             * @param end the upper bound of the range of contacts (not inclusive)
272             * @return the range of contacts
273             */
274            @Override
275            public List<Contact> getContacts(int start, int end) {
276                    return contactPersistence.findAll(start, end);
277            }
278    
279            /**
280             * Returns the number of contacts.
281             *
282             * @return the number of contacts
283             */
284            @Override
285            public int getContactsCount() {
286                    return contactPersistence.countAll();
287            }
288    
289            /**
290             * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
291             *
292             * @param contact the contact
293             * @return the contact that was updated
294             */
295            @Indexable(type = IndexableType.REINDEX)
296            @Override
297            public Contact updateContact(Contact contact) {
298                    return contactPersistence.update(contact);
299            }
300    
301            /**
302             * Returns the contact local service.
303             *
304             * @return the contact local service
305             */
306            public ContactLocalService getContactLocalService() {
307                    return contactLocalService;
308            }
309    
310            /**
311             * Sets the contact local service.
312             *
313             * @param contactLocalService the contact local service
314             */
315            public void setContactLocalService(ContactLocalService contactLocalService) {
316                    this.contactLocalService = contactLocalService;
317            }
318    
319            /**
320             * Returns the contact remote service.
321             *
322             * @return the contact remote service
323             */
324            public com.liferay.portal.service.ContactService getContactService() {
325                    return contactService;
326            }
327    
328            /**
329             * Sets the contact remote service.
330             *
331             * @param contactService the contact remote service
332             */
333            public void setContactService(
334                    com.liferay.portal.service.ContactService contactService) {
335                    this.contactService = contactService;
336            }
337    
338            /**
339             * Returns the contact persistence.
340             *
341             * @return the contact persistence
342             */
343            public ContactPersistence getContactPersistence() {
344                    return contactPersistence;
345            }
346    
347            /**
348             * Sets the contact persistence.
349             *
350             * @param contactPersistence the contact persistence
351             */
352            public void setContactPersistence(ContactPersistence contactPersistence) {
353                    this.contactPersistence = contactPersistence;
354            }
355    
356            /**
357             * Returns the counter local service.
358             *
359             * @return the counter local service
360             */
361            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
362                    return counterLocalService;
363            }
364    
365            /**
366             * Sets the counter local service.
367             *
368             * @param counterLocalService the counter local service
369             */
370            public void setCounterLocalService(
371                    com.liferay.counter.service.CounterLocalService counterLocalService) {
372                    this.counterLocalService = counterLocalService;
373            }
374    
375            /**
376             * Returns the address local service.
377             *
378             * @return the address local service
379             */
380            public com.liferay.portal.service.AddressLocalService getAddressLocalService() {
381                    return addressLocalService;
382            }
383    
384            /**
385             * Sets the address local service.
386             *
387             * @param addressLocalService the address local service
388             */
389            public void setAddressLocalService(
390                    com.liferay.portal.service.AddressLocalService addressLocalService) {
391                    this.addressLocalService = addressLocalService;
392            }
393    
394            /**
395             * Returns the address remote service.
396             *
397             * @return the address remote service
398             */
399            public com.liferay.portal.service.AddressService getAddressService() {
400                    return addressService;
401            }
402    
403            /**
404             * Sets the address remote service.
405             *
406             * @param addressService the address remote service
407             */
408            public void setAddressService(
409                    com.liferay.portal.service.AddressService addressService) {
410                    this.addressService = addressService;
411            }
412    
413            /**
414             * Returns the address persistence.
415             *
416             * @return the address persistence
417             */
418            public AddressPersistence getAddressPersistence() {
419                    return addressPersistence;
420            }
421    
422            /**
423             * Sets the address persistence.
424             *
425             * @param addressPersistence the address persistence
426             */
427            public void setAddressPersistence(AddressPersistence addressPersistence) {
428                    this.addressPersistence = addressPersistence;
429            }
430    
431            /**
432             * Returns the email address local service.
433             *
434             * @return the email address local service
435             */
436            public com.liferay.portal.service.EmailAddressLocalService getEmailAddressLocalService() {
437                    return emailAddressLocalService;
438            }
439    
440            /**
441             * Sets the email address local service.
442             *
443             * @param emailAddressLocalService the email address local service
444             */
445            public void setEmailAddressLocalService(
446                    com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService) {
447                    this.emailAddressLocalService = emailAddressLocalService;
448            }
449    
450            /**
451             * Returns the email address remote service.
452             *
453             * @return the email address remote service
454             */
455            public com.liferay.portal.service.EmailAddressService getEmailAddressService() {
456                    return emailAddressService;
457            }
458    
459            /**
460             * Sets the email address remote service.
461             *
462             * @param emailAddressService the email address remote service
463             */
464            public void setEmailAddressService(
465                    com.liferay.portal.service.EmailAddressService emailAddressService) {
466                    this.emailAddressService = emailAddressService;
467            }
468    
469            /**
470             * Returns the email address persistence.
471             *
472             * @return the email address persistence
473             */
474            public EmailAddressPersistence getEmailAddressPersistence() {
475                    return emailAddressPersistence;
476            }
477    
478            /**
479             * Sets the email address persistence.
480             *
481             * @param emailAddressPersistence the email address persistence
482             */
483            public void setEmailAddressPersistence(
484                    EmailAddressPersistence emailAddressPersistence) {
485                    this.emailAddressPersistence = emailAddressPersistence;
486            }
487    
488            /**
489             * Returns the organization local service.
490             *
491             * @return the organization local service
492             */
493            public com.liferay.portal.service.OrganizationLocalService getOrganizationLocalService() {
494                    return organizationLocalService;
495            }
496    
497            /**
498             * Sets the organization local service.
499             *
500             * @param organizationLocalService the organization local service
501             */
502            public void setOrganizationLocalService(
503                    com.liferay.portal.service.OrganizationLocalService organizationLocalService) {
504                    this.organizationLocalService = organizationLocalService;
505            }
506    
507            /**
508             * Returns the organization remote service.
509             *
510             * @return the organization remote service
511             */
512            public com.liferay.portal.service.OrganizationService getOrganizationService() {
513                    return organizationService;
514            }
515    
516            /**
517             * Sets the organization remote service.
518             *
519             * @param organizationService the organization remote service
520             */
521            public void setOrganizationService(
522                    com.liferay.portal.service.OrganizationService organizationService) {
523                    this.organizationService = organizationService;
524            }
525    
526            /**
527             * Returns the organization persistence.
528             *
529             * @return the organization persistence
530             */
531            public OrganizationPersistence getOrganizationPersistence() {
532                    return organizationPersistence;
533            }
534    
535            /**
536             * Sets the organization persistence.
537             *
538             * @param organizationPersistence the organization persistence
539             */
540            public void setOrganizationPersistence(
541                    OrganizationPersistence organizationPersistence) {
542                    this.organizationPersistence = organizationPersistence;
543            }
544    
545            /**
546             * Returns the organization finder.
547             *
548             * @return the organization finder
549             */
550            public OrganizationFinder getOrganizationFinder() {
551                    return organizationFinder;
552            }
553    
554            /**
555             * Sets the organization finder.
556             *
557             * @param organizationFinder the organization finder
558             */
559            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
560                    this.organizationFinder = organizationFinder;
561            }
562    
563            /**
564             * Returns the phone local service.
565             *
566             * @return the phone local service
567             */
568            public com.liferay.portal.service.PhoneLocalService getPhoneLocalService() {
569                    return phoneLocalService;
570            }
571    
572            /**
573             * Sets the phone local service.
574             *
575             * @param phoneLocalService the phone local service
576             */
577            public void setPhoneLocalService(
578                    com.liferay.portal.service.PhoneLocalService phoneLocalService) {
579                    this.phoneLocalService = phoneLocalService;
580            }
581    
582            /**
583             * Returns the phone remote service.
584             *
585             * @return the phone remote service
586             */
587            public com.liferay.portal.service.PhoneService getPhoneService() {
588                    return phoneService;
589            }
590    
591            /**
592             * Sets the phone remote service.
593             *
594             * @param phoneService the phone remote service
595             */
596            public void setPhoneService(
597                    com.liferay.portal.service.PhoneService phoneService) {
598                    this.phoneService = phoneService;
599            }
600    
601            /**
602             * Returns the phone persistence.
603             *
604             * @return the phone persistence
605             */
606            public PhonePersistence getPhonePersistence() {
607                    return phonePersistence;
608            }
609    
610            /**
611             * Sets the phone persistence.
612             *
613             * @param phonePersistence the phone persistence
614             */
615            public void setPhonePersistence(PhonePersistence phonePersistence) {
616                    this.phonePersistence = phonePersistence;
617            }
618    
619            /**
620             * Returns the user local service.
621             *
622             * @return the user local service
623             */
624            public com.liferay.portal.service.UserLocalService getUserLocalService() {
625                    return userLocalService;
626            }
627    
628            /**
629             * Sets the user local service.
630             *
631             * @param userLocalService the user local service
632             */
633            public void setUserLocalService(
634                    com.liferay.portal.service.UserLocalService userLocalService) {
635                    this.userLocalService = userLocalService;
636            }
637    
638            /**
639             * Returns the user remote service.
640             *
641             * @return the user remote service
642             */
643            public com.liferay.portal.service.UserService getUserService() {
644                    return userService;
645            }
646    
647            /**
648             * Sets the user remote service.
649             *
650             * @param userService the user remote service
651             */
652            public void setUserService(
653                    com.liferay.portal.service.UserService userService) {
654                    this.userService = userService;
655            }
656    
657            /**
658             * Returns the user persistence.
659             *
660             * @return the user persistence
661             */
662            public UserPersistence getUserPersistence() {
663                    return userPersistence;
664            }
665    
666            /**
667             * Sets the user persistence.
668             *
669             * @param userPersistence the user persistence
670             */
671            public void setUserPersistence(UserPersistence userPersistence) {
672                    this.userPersistence = userPersistence;
673            }
674    
675            /**
676             * Returns the user finder.
677             *
678             * @return the user finder
679             */
680            public UserFinder getUserFinder() {
681                    return userFinder;
682            }
683    
684            /**
685             * Sets the user finder.
686             *
687             * @param userFinder the user finder
688             */
689            public void setUserFinder(UserFinder userFinder) {
690                    this.userFinder = userFinder;
691            }
692    
693            /**
694             * Returns the website local service.
695             *
696             * @return the website local service
697             */
698            public com.liferay.portal.service.WebsiteLocalService getWebsiteLocalService() {
699                    return websiteLocalService;
700            }
701    
702            /**
703             * Sets the website local service.
704             *
705             * @param websiteLocalService the website local service
706             */
707            public void setWebsiteLocalService(
708                    com.liferay.portal.service.WebsiteLocalService websiteLocalService) {
709                    this.websiteLocalService = websiteLocalService;
710            }
711    
712            /**
713             * Returns the website remote service.
714             *
715             * @return the website remote service
716             */
717            public com.liferay.portal.service.WebsiteService getWebsiteService() {
718                    return websiteService;
719            }
720    
721            /**
722             * Sets the website remote service.
723             *
724             * @param websiteService the website remote service
725             */
726            public void setWebsiteService(
727                    com.liferay.portal.service.WebsiteService websiteService) {
728                    this.websiteService = websiteService;
729            }
730    
731            /**
732             * Returns the website persistence.
733             *
734             * @return the website persistence
735             */
736            public WebsitePersistence getWebsitePersistence() {
737                    return websitePersistence;
738            }
739    
740            /**
741             * Sets the website persistence.
742             *
743             * @param websitePersistence the website persistence
744             */
745            public void setWebsitePersistence(WebsitePersistence websitePersistence) {
746                    this.websitePersistence = websitePersistence;
747            }
748    
749            public void afterPropertiesSet() {
750                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Contact",
751                            contactLocalService);
752            }
753    
754            public void destroy() {
755                    persistedModelLocalServiceRegistry.unregister(
756                            "com.liferay.portal.model.Contact");
757            }
758    
759            /**
760             * Returns the Spring bean ID for this bean.
761             *
762             * @return the Spring bean ID for this bean
763             */
764            @Override
765            public String getBeanIdentifier() {
766                    return _beanIdentifier;
767            }
768    
769            /**
770             * Sets the Spring bean ID for this bean.
771             *
772             * @param beanIdentifier the Spring bean ID for this bean
773             */
774            @Override
775            public void setBeanIdentifier(String beanIdentifier) {
776                    _beanIdentifier = beanIdentifier;
777            }
778    
779            protected Class<?> getModelClass() {
780                    return Contact.class;
781            }
782    
783            protected String getModelClassName() {
784                    return Contact.class.getName();
785            }
786    
787            /**
788             * Performs a SQL query.
789             *
790             * @param sql the sql query
791             */
792            protected void runSQL(String sql) {
793                    try {
794                            DataSource dataSource = contactPersistence.getDataSource();
795    
796                            DB db = DBFactoryUtil.getDB();
797    
798                            sql = db.buildSQL(sql);
799                            sql = PortalUtil.transformSQL(sql);
800    
801                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
802                                            sql, new int[0]);
803    
804                            sqlUpdate.update();
805                    }
806                    catch (Exception e) {
807                            throw new SystemException(e);
808                    }
809            }
810    
811            @BeanReference(type = ContactLocalService.class)
812            protected ContactLocalService contactLocalService;
813            @BeanReference(type = com.liferay.portal.service.ContactService.class)
814            protected com.liferay.portal.service.ContactService contactService;
815            @BeanReference(type = ContactPersistence.class)
816            protected ContactPersistence contactPersistence;
817            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
818            protected com.liferay.counter.service.CounterLocalService counterLocalService;
819            @BeanReference(type = com.liferay.portal.service.AddressLocalService.class)
820            protected com.liferay.portal.service.AddressLocalService addressLocalService;
821            @BeanReference(type = com.liferay.portal.service.AddressService.class)
822            protected com.liferay.portal.service.AddressService addressService;
823            @BeanReference(type = AddressPersistence.class)
824            protected AddressPersistence addressPersistence;
825            @BeanReference(type = com.liferay.portal.service.EmailAddressLocalService.class)
826            protected com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService;
827            @BeanReference(type = com.liferay.portal.service.EmailAddressService.class)
828            protected com.liferay.portal.service.EmailAddressService emailAddressService;
829            @BeanReference(type = EmailAddressPersistence.class)
830            protected EmailAddressPersistence emailAddressPersistence;
831            @BeanReference(type = com.liferay.portal.service.OrganizationLocalService.class)
832            protected com.liferay.portal.service.OrganizationLocalService organizationLocalService;
833            @BeanReference(type = com.liferay.portal.service.OrganizationService.class)
834            protected com.liferay.portal.service.OrganizationService organizationService;
835            @BeanReference(type = OrganizationPersistence.class)
836            protected OrganizationPersistence organizationPersistence;
837            @BeanReference(type = OrganizationFinder.class)
838            protected OrganizationFinder organizationFinder;
839            @BeanReference(type = com.liferay.portal.service.PhoneLocalService.class)
840            protected com.liferay.portal.service.PhoneLocalService phoneLocalService;
841            @BeanReference(type = com.liferay.portal.service.PhoneService.class)
842            protected com.liferay.portal.service.PhoneService phoneService;
843            @BeanReference(type = PhonePersistence.class)
844            protected PhonePersistence phonePersistence;
845            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
846            protected com.liferay.portal.service.UserLocalService userLocalService;
847            @BeanReference(type = com.liferay.portal.service.UserService.class)
848            protected com.liferay.portal.service.UserService userService;
849            @BeanReference(type = UserPersistence.class)
850            protected UserPersistence userPersistence;
851            @BeanReference(type = UserFinder.class)
852            protected UserFinder userFinder;
853            @BeanReference(type = com.liferay.portal.service.WebsiteLocalService.class)
854            protected com.liferay.portal.service.WebsiteLocalService websiteLocalService;
855            @BeanReference(type = com.liferay.portal.service.WebsiteService.class)
856            protected com.liferay.portal.service.WebsiteService websiteService;
857            @BeanReference(type = WebsitePersistence.class)
858            protected WebsitePersistence websitePersistence;
859            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
860            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
861            private String _beanIdentifier;
862    }