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 com.liferay.portal.service.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(
316                    com.liferay.portal.service.ContactLocalService contactLocalService) {
317                    this.contactLocalService = contactLocalService;
318            }
319    
320            /**
321             * Returns the contact remote service.
322             *
323             * @return the contact remote service
324             */
325            public com.liferay.portal.service.ContactService getContactService() {
326                    return contactService;
327            }
328    
329            /**
330             * Sets the contact remote service.
331             *
332             * @param contactService the contact remote service
333             */
334            public void setContactService(
335                    com.liferay.portal.service.ContactService contactService) {
336                    this.contactService = contactService;
337            }
338    
339            /**
340             * Returns the contact persistence.
341             *
342             * @return the contact persistence
343             */
344            public ContactPersistence getContactPersistence() {
345                    return contactPersistence;
346            }
347    
348            /**
349             * Sets the contact persistence.
350             *
351             * @param contactPersistence the contact persistence
352             */
353            public void setContactPersistence(ContactPersistence contactPersistence) {
354                    this.contactPersistence = contactPersistence;
355            }
356    
357            /**
358             * Returns the counter local service.
359             *
360             * @return the counter local service
361             */
362            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
363                    return counterLocalService;
364            }
365    
366            /**
367             * Sets the counter local service.
368             *
369             * @param counterLocalService the counter local service
370             */
371            public void setCounterLocalService(
372                    com.liferay.counter.service.CounterLocalService counterLocalService) {
373                    this.counterLocalService = counterLocalService;
374            }
375    
376            /**
377             * Returns the address local service.
378             *
379             * @return the address local service
380             */
381            public com.liferay.portal.service.AddressLocalService getAddressLocalService() {
382                    return addressLocalService;
383            }
384    
385            /**
386             * Sets the address local service.
387             *
388             * @param addressLocalService the address local service
389             */
390            public void setAddressLocalService(
391                    com.liferay.portal.service.AddressLocalService addressLocalService) {
392                    this.addressLocalService = addressLocalService;
393            }
394    
395            /**
396             * Returns the address remote service.
397             *
398             * @return the address remote service
399             */
400            public com.liferay.portal.service.AddressService getAddressService() {
401                    return addressService;
402            }
403    
404            /**
405             * Sets the address remote service.
406             *
407             * @param addressService the address remote service
408             */
409            public void setAddressService(
410                    com.liferay.portal.service.AddressService addressService) {
411                    this.addressService = addressService;
412            }
413    
414            /**
415             * Returns the address persistence.
416             *
417             * @return the address persistence
418             */
419            public AddressPersistence getAddressPersistence() {
420                    return addressPersistence;
421            }
422    
423            /**
424             * Sets the address persistence.
425             *
426             * @param addressPersistence the address persistence
427             */
428            public void setAddressPersistence(AddressPersistence addressPersistence) {
429                    this.addressPersistence = addressPersistence;
430            }
431    
432            /**
433             * Returns the email address local service.
434             *
435             * @return the email address local service
436             */
437            public com.liferay.portal.service.EmailAddressLocalService getEmailAddressLocalService() {
438                    return emailAddressLocalService;
439            }
440    
441            /**
442             * Sets the email address local service.
443             *
444             * @param emailAddressLocalService the email address local service
445             */
446            public void setEmailAddressLocalService(
447                    com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService) {
448                    this.emailAddressLocalService = emailAddressLocalService;
449            }
450    
451            /**
452             * Returns the email address remote service.
453             *
454             * @return the email address remote service
455             */
456            public com.liferay.portal.service.EmailAddressService getEmailAddressService() {
457                    return emailAddressService;
458            }
459    
460            /**
461             * Sets the email address remote service.
462             *
463             * @param emailAddressService the email address remote service
464             */
465            public void setEmailAddressService(
466                    com.liferay.portal.service.EmailAddressService emailAddressService) {
467                    this.emailAddressService = emailAddressService;
468            }
469    
470            /**
471             * Returns the email address persistence.
472             *
473             * @return the email address persistence
474             */
475            public EmailAddressPersistence getEmailAddressPersistence() {
476                    return emailAddressPersistence;
477            }
478    
479            /**
480             * Sets the email address persistence.
481             *
482             * @param emailAddressPersistence the email address persistence
483             */
484            public void setEmailAddressPersistence(
485                    EmailAddressPersistence emailAddressPersistence) {
486                    this.emailAddressPersistence = emailAddressPersistence;
487            }
488    
489            /**
490             * Returns the organization local service.
491             *
492             * @return the organization local service
493             */
494            public com.liferay.portal.service.OrganizationLocalService getOrganizationLocalService() {
495                    return organizationLocalService;
496            }
497    
498            /**
499             * Sets the organization local service.
500             *
501             * @param organizationLocalService the organization local service
502             */
503            public void setOrganizationLocalService(
504                    com.liferay.portal.service.OrganizationLocalService organizationLocalService) {
505                    this.organizationLocalService = organizationLocalService;
506            }
507    
508            /**
509             * Returns the organization remote service.
510             *
511             * @return the organization remote service
512             */
513            public com.liferay.portal.service.OrganizationService getOrganizationService() {
514                    return organizationService;
515            }
516    
517            /**
518             * Sets the organization remote service.
519             *
520             * @param organizationService the organization remote service
521             */
522            public void setOrganizationService(
523                    com.liferay.portal.service.OrganizationService organizationService) {
524                    this.organizationService = organizationService;
525            }
526    
527            /**
528             * Returns the organization persistence.
529             *
530             * @return the organization persistence
531             */
532            public OrganizationPersistence getOrganizationPersistence() {
533                    return organizationPersistence;
534            }
535    
536            /**
537             * Sets the organization persistence.
538             *
539             * @param organizationPersistence the organization persistence
540             */
541            public void setOrganizationPersistence(
542                    OrganizationPersistence organizationPersistence) {
543                    this.organizationPersistence = organizationPersistence;
544            }
545    
546            /**
547             * Returns the organization finder.
548             *
549             * @return the organization finder
550             */
551            public OrganizationFinder getOrganizationFinder() {
552                    return organizationFinder;
553            }
554    
555            /**
556             * Sets the organization finder.
557             *
558             * @param organizationFinder the organization finder
559             */
560            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
561                    this.organizationFinder = organizationFinder;
562            }
563    
564            /**
565             * Returns the phone local service.
566             *
567             * @return the phone local service
568             */
569            public com.liferay.portal.service.PhoneLocalService getPhoneLocalService() {
570                    return phoneLocalService;
571            }
572    
573            /**
574             * Sets the phone local service.
575             *
576             * @param phoneLocalService the phone local service
577             */
578            public void setPhoneLocalService(
579                    com.liferay.portal.service.PhoneLocalService phoneLocalService) {
580                    this.phoneLocalService = phoneLocalService;
581            }
582    
583            /**
584             * Returns the phone remote service.
585             *
586             * @return the phone remote service
587             */
588            public com.liferay.portal.service.PhoneService getPhoneService() {
589                    return phoneService;
590            }
591    
592            /**
593             * Sets the phone remote service.
594             *
595             * @param phoneService the phone remote service
596             */
597            public void setPhoneService(
598                    com.liferay.portal.service.PhoneService phoneService) {
599                    this.phoneService = phoneService;
600            }
601    
602            /**
603             * Returns the phone persistence.
604             *
605             * @return the phone persistence
606             */
607            public PhonePersistence getPhonePersistence() {
608                    return phonePersistence;
609            }
610    
611            /**
612             * Sets the phone persistence.
613             *
614             * @param phonePersistence the phone persistence
615             */
616            public void setPhonePersistence(PhonePersistence phonePersistence) {
617                    this.phonePersistence = phonePersistence;
618            }
619    
620            /**
621             * Returns the user local service.
622             *
623             * @return the user local service
624             */
625            public com.liferay.portal.service.UserLocalService getUserLocalService() {
626                    return userLocalService;
627            }
628    
629            /**
630             * Sets the user local service.
631             *
632             * @param userLocalService the user local service
633             */
634            public void setUserLocalService(
635                    com.liferay.portal.service.UserLocalService userLocalService) {
636                    this.userLocalService = userLocalService;
637            }
638    
639            /**
640             * Returns the user remote service.
641             *
642             * @return the user remote service
643             */
644            public com.liferay.portal.service.UserService getUserService() {
645                    return userService;
646            }
647    
648            /**
649             * Sets the user remote service.
650             *
651             * @param userService the user remote service
652             */
653            public void setUserService(
654                    com.liferay.portal.service.UserService userService) {
655                    this.userService = userService;
656            }
657    
658            /**
659             * Returns the user persistence.
660             *
661             * @return the user persistence
662             */
663            public UserPersistence getUserPersistence() {
664                    return userPersistence;
665            }
666    
667            /**
668             * Sets the user persistence.
669             *
670             * @param userPersistence the user persistence
671             */
672            public void setUserPersistence(UserPersistence userPersistence) {
673                    this.userPersistence = userPersistence;
674            }
675    
676            /**
677             * Returns the user finder.
678             *
679             * @return the user finder
680             */
681            public UserFinder getUserFinder() {
682                    return userFinder;
683            }
684    
685            /**
686             * Sets the user finder.
687             *
688             * @param userFinder the user finder
689             */
690            public void setUserFinder(UserFinder userFinder) {
691                    this.userFinder = userFinder;
692            }
693    
694            /**
695             * Returns the website local service.
696             *
697             * @return the website local service
698             */
699            public com.liferay.portal.service.WebsiteLocalService getWebsiteLocalService() {
700                    return websiteLocalService;
701            }
702    
703            /**
704             * Sets the website local service.
705             *
706             * @param websiteLocalService the website local service
707             */
708            public void setWebsiteLocalService(
709                    com.liferay.portal.service.WebsiteLocalService websiteLocalService) {
710                    this.websiteLocalService = websiteLocalService;
711            }
712    
713            /**
714             * Returns the website remote service.
715             *
716             * @return the website remote service
717             */
718            public com.liferay.portal.service.WebsiteService getWebsiteService() {
719                    return websiteService;
720            }
721    
722            /**
723             * Sets the website remote service.
724             *
725             * @param websiteService the website remote service
726             */
727            public void setWebsiteService(
728                    com.liferay.portal.service.WebsiteService websiteService) {
729                    this.websiteService = websiteService;
730            }
731    
732            /**
733             * Returns the website persistence.
734             *
735             * @return the website persistence
736             */
737            public WebsitePersistence getWebsitePersistence() {
738                    return websitePersistence;
739            }
740    
741            /**
742             * Sets the website persistence.
743             *
744             * @param websitePersistence the website persistence
745             */
746            public void setWebsitePersistence(WebsitePersistence websitePersistence) {
747                    this.websitePersistence = websitePersistence;
748            }
749    
750            public void afterPropertiesSet() {
751                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Contact",
752                            contactLocalService);
753            }
754    
755            public void destroy() {
756                    persistedModelLocalServiceRegistry.unregister(
757                            "com.liferay.portal.model.Contact");
758            }
759    
760            /**
761             * Returns the Spring bean ID for this bean.
762             *
763             * @return the Spring bean ID for this bean
764             */
765            @Override
766            public String getBeanIdentifier() {
767                    return _beanIdentifier;
768            }
769    
770            /**
771             * Sets the Spring bean ID for this bean.
772             *
773             * @param beanIdentifier the Spring bean ID for this bean
774             */
775            @Override
776            public void setBeanIdentifier(String beanIdentifier) {
777                    _beanIdentifier = beanIdentifier;
778            }
779    
780            protected Class<?> getModelClass() {
781                    return Contact.class;
782            }
783    
784            protected String getModelClassName() {
785                    return Contact.class.getName();
786            }
787    
788            /**
789             * Performs a SQL query.
790             *
791             * @param sql the sql query
792             */
793            protected void runSQL(String sql) {
794                    try {
795                            DataSource dataSource = contactPersistence.getDataSource();
796    
797                            DB db = DBFactoryUtil.getDB();
798    
799                            sql = db.buildSQL(sql);
800                            sql = PortalUtil.transformSQL(sql);
801    
802                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
803                                            sql, new int[0]);
804    
805                            sqlUpdate.update();
806                    }
807                    catch (Exception e) {
808                            throw new SystemException(e);
809                    }
810            }
811    
812            @BeanReference(type = com.liferay.portal.service.ContactLocalService.class)
813            protected com.liferay.portal.service.ContactLocalService contactLocalService;
814            @BeanReference(type = com.liferay.portal.service.ContactService.class)
815            protected com.liferay.portal.service.ContactService contactService;
816            @BeanReference(type = ContactPersistence.class)
817            protected ContactPersistence contactPersistence;
818            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
819            protected com.liferay.counter.service.CounterLocalService counterLocalService;
820            @BeanReference(type = com.liferay.portal.service.AddressLocalService.class)
821            protected com.liferay.portal.service.AddressLocalService addressLocalService;
822            @BeanReference(type = com.liferay.portal.service.AddressService.class)
823            protected com.liferay.portal.service.AddressService addressService;
824            @BeanReference(type = AddressPersistence.class)
825            protected AddressPersistence addressPersistence;
826            @BeanReference(type = com.liferay.portal.service.EmailAddressLocalService.class)
827            protected com.liferay.portal.service.EmailAddressLocalService emailAddressLocalService;
828            @BeanReference(type = com.liferay.portal.service.EmailAddressService.class)
829            protected com.liferay.portal.service.EmailAddressService emailAddressService;
830            @BeanReference(type = EmailAddressPersistence.class)
831            protected EmailAddressPersistence emailAddressPersistence;
832            @BeanReference(type = com.liferay.portal.service.OrganizationLocalService.class)
833            protected com.liferay.portal.service.OrganizationLocalService organizationLocalService;
834            @BeanReference(type = com.liferay.portal.service.OrganizationService.class)
835            protected com.liferay.portal.service.OrganizationService organizationService;
836            @BeanReference(type = OrganizationPersistence.class)
837            protected OrganizationPersistence organizationPersistence;
838            @BeanReference(type = OrganizationFinder.class)
839            protected OrganizationFinder organizationFinder;
840            @BeanReference(type = com.liferay.portal.service.PhoneLocalService.class)
841            protected com.liferay.portal.service.PhoneLocalService phoneLocalService;
842            @BeanReference(type = com.liferay.portal.service.PhoneService.class)
843            protected com.liferay.portal.service.PhoneService phoneService;
844            @BeanReference(type = PhonePersistence.class)
845            protected PhonePersistence phonePersistence;
846            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
847            protected com.liferay.portal.service.UserLocalService userLocalService;
848            @BeanReference(type = com.liferay.portal.service.UserService.class)
849            protected com.liferay.portal.service.UserService userService;
850            @BeanReference(type = UserPersistence.class)
851            protected UserPersistence userPersistence;
852            @BeanReference(type = UserFinder.class)
853            protected UserFinder userFinder;
854            @BeanReference(type = com.liferay.portal.service.WebsiteLocalService.class)
855            protected com.liferay.portal.service.WebsiteLocalService websiteLocalService;
856            @BeanReference(type = com.liferay.portal.service.WebsiteService.class)
857            protected com.liferay.portal.service.WebsiteService websiteService;
858            @BeanReference(type = WebsitePersistence.class)
859            protected WebsitePersistence websitePersistence;
860            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
861            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
862            private String _beanIdentifier;
863    }