001    /**
002     * Copyright (c) 2000-2013 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.portlet.polls.service.base;
016    
017    import com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.util.OrderByComparator;
029    import com.liferay.portal.model.PersistedModel;
030    import com.liferay.portal.service.BaseLocalServiceImpl;
031    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
032    import com.liferay.portal.service.persistence.SystemEventPersistence;
033    import com.liferay.portal.service.persistence.UserFinder;
034    import com.liferay.portal.service.persistence.UserPersistence;
035    
036    import com.liferay.portlet.polls.model.PollsQuestion;
037    import com.liferay.portlet.polls.service.PollsQuestionLocalService;
038    import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
039    import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
040    import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
041    
042    import java.io.Serializable;
043    
044    import java.util.List;
045    
046    import javax.sql.DataSource;
047    
048    /**
049     * Provides the base implementation for the polls question local service.
050     *
051     * <p>
052     * 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.portlet.polls.service.impl.PollsQuestionLocalServiceImpl}.
053     * </p>
054     *
055     * @author Brian Wing Shun Chan
056     * @see com.liferay.portlet.polls.service.impl.PollsQuestionLocalServiceImpl
057     * @see com.liferay.portlet.polls.service.PollsQuestionLocalServiceUtil
058     * @generated
059     */
060    public abstract class PollsQuestionLocalServiceBaseImpl
061            extends BaseLocalServiceImpl implements PollsQuestionLocalService,
062                    IdentifiableBean {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.polls.service.PollsQuestionLocalServiceUtil} to access the polls question local service.
067             */
068    
069            /**
070             * Adds the polls question to the database. Also notifies the appropriate model listeners.
071             *
072             * @param pollsQuestion the polls question
073             * @return the polls question that was added
074             * @throws SystemException if a system exception occurred
075             */
076            @Indexable(type = IndexableType.REINDEX)
077            @Override
078            public PollsQuestion addPollsQuestion(PollsQuestion pollsQuestion)
079                    throws SystemException {
080                    pollsQuestion.setNew(true);
081    
082                    return pollsQuestionPersistence.update(pollsQuestion);
083            }
084    
085            /**
086             * Creates a new polls question with the primary key. Does not add the polls question to the database.
087             *
088             * @param questionId the primary key for the new polls question
089             * @return the new polls question
090             */
091            @Override
092            public PollsQuestion createPollsQuestion(long questionId) {
093                    return pollsQuestionPersistence.create(questionId);
094            }
095    
096            /**
097             * Deletes the polls question with the primary key from the database. Also notifies the appropriate model listeners.
098             *
099             * @param questionId the primary key of the polls question
100             * @return the polls question that was removed
101             * @throws PortalException if a polls question with the primary key could not be found
102             * @throws SystemException if a system exception occurred
103             */
104            @Indexable(type = IndexableType.DELETE)
105            @Override
106            public PollsQuestion deletePollsQuestion(long questionId)
107                    throws PortalException, SystemException {
108                    return pollsQuestionPersistence.remove(questionId);
109            }
110    
111            /**
112             * Deletes the polls question from the database. Also notifies the appropriate model listeners.
113             *
114             * @param pollsQuestion the polls question
115             * @return the polls question that was removed
116             * @throws SystemException if a system exception occurred
117             */
118            @Indexable(type = IndexableType.DELETE)
119            @Override
120            public PollsQuestion deletePollsQuestion(PollsQuestion pollsQuestion)
121                    throws SystemException {
122                    return pollsQuestionPersistence.remove(pollsQuestion);
123            }
124    
125            @Override
126            public DynamicQuery dynamicQuery() {
127                    Class<?> clazz = getClass();
128    
129                    return DynamicQueryFactoryUtil.forClass(PollsQuestion.class,
130                            clazz.getClassLoader());
131            }
132    
133            /**
134             * Performs a dynamic query on the database and returns the matching rows.
135             *
136             * @param dynamicQuery the dynamic query
137             * @return the matching rows
138             * @throws SystemException if a system exception occurred
139             */
140            @Override
141            @SuppressWarnings("rawtypes")
142            public List dynamicQuery(DynamicQuery dynamicQuery)
143                    throws SystemException {
144                    return pollsQuestionPersistence.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.portlet.polls.model.impl.PollsQuestionModelImpl}. 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             * @throws SystemException if a system exception occurred
159             */
160            @Override
161            @SuppressWarnings("rawtypes")
162            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
163                    throws SystemException {
164                    return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
165                            start, end);
166            }
167    
168            /**
169             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
170             *
171             * <p>
172             * 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.portlet.polls.model.impl.PollsQuestionModelImpl}. 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.
173             * </p>
174             *
175             * @param dynamicQuery the dynamic query
176             * @param start the lower bound of the range of model instances
177             * @param end the upper bound of the range of model instances (not inclusive)
178             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
179             * @return the ordered range of matching rows
180             * @throws SystemException if a system exception occurred
181             */
182            @Override
183            @SuppressWarnings("rawtypes")
184            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185                    OrderByComparator orderByComparator) throws SystemException {
186                    return pollsQuestionPersistence.findWithDynamicQuery(dynamicQuery,
187                            start, end, orderByComparator);
188            }
189    
190            /**
191             * Returns the number of rows that match the dynamic query.
192             *
193             * @param dynamicQuery the dynamic query
194             * @return the number of rows that match the dynamic query
195             * @throws SystemException if a system exception occurred
196             */
197            @Override
198            public long dynamicQueryCount(DynamicQuery dynamicQuery)
199                    throws SystemException {
200                    return pollsQuestionPersistence.countWithDynamicQuery(dynamicQuery);
201            }
202    
203            /**
204             * Returns the number of rows that match the dynamic query.
205             *
206             * @param dynamicQuery the dynamic query
207             * @param projection the projection to apply to the query
208             * @return the number of rows that match the dynamic query
209             * @throws SystemException if a system exception occurred
210             */
211            @Override
212            public long dynamicQueryCount(DynamicQuery dynamicQuery,
213                    Projection projection) throws SystemException {
214                    return pollsQuestionPersistence.countWithDynamicQuery(dynamicQuery,
215                            projection);
216            }
217    
218            @Override
219            public PollsQuestion fetchPollsQuestion(long questionId)
220                    throws SystemException {
221                    return pollsQuestionPersistence.fetchByPrimaryKey(questionId);
222            }
223    
224            /**
225             * Returns the polls question with the matching UUID and company.
226             *
227             * @param uuid the polls question's UUID
228             * @param  companyId the primary key of the company
229             * @return the matching polls question, or <code>null</code> if a matching polls question could not be found
230             * @throws SystemException if a system exception occurred
231             */
232            @Override
233            public PollsQuestion fetchPollsQuestionByUuidAndCompanyId(String uuid,
234                    long companyId) throws SystemException {
235                    return pollsQuestionPersistence.fetchByUuid_C_First(uuid, companyId,
236                            null);
237            }
238    
239            /**
240             * Returns the polls question matching the UUID and group.
241             *
242             * @param uuid the polls question's UUID
243             * @param groupId the primary key of the group
244             * @return the matching polls question, or <code>null</code> if a matching polls question could not be found
245             * @throws SystemException if a system exception occurred
246             */
247            @Override
248            public PollsQuestion fetchPollsQuestionByUuidAndGroupId(String uuid,
249                    long groupId) throws SystemException {
250                    return pollsQuestionPersistence.fetchByUUID_G(uuid, groupId);
251            }
252    
253            /**
254             * Returns the polls question with the primary key.
255             *
256             * @param questionId the primary key of the polls question
257             * @return the polls question
258             * @throws PortalException if a polls question with the primary key could not be found
259             * @throws SystemException if a system exception occurred
260             */
261            @Override
262            public PollsQuestion getPollsQuestion(long questionId)
263                    throws PortalException, SystemException {
264                    return pollsQuestionPersistence.findByPrimaryKey(questionId);
265            }
266    
267            @Override
268            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
269                    throws PortalException, SystemException {
270                    return pollsQuestionPersistence.findByPrimaryKey(primaryKeyObj);
271            }
272    
273            /**
274             * Returns the polls question with the matching UUID and company.
275             *
276             * @param uuid the polls question's UUID
277             * @param  companyId the primary key of the company
278             * @return the matching polls question
279             * @throws PortalException if a matching polls question could not be found
280             * @throws SystemException if a system exception occurred
281             */
282            @Override
283            public PollsQuestion getPollsQuestionByUuidAndCompanyId(String uuid,
284                    long companyId) throws PortalException, SystemException {
285                    return pollsQuestionPersistence.findByUuid_C_First(uuid, companyId, null);
286            }
287    
288            /**
289             * Returns the polls question matching the UUID and group.
290             *
291             * @param uuid the polls question's UUID
292             * @param groupId the primary key of the group
293             * @return the matching polls question
294             * @throws PortalException if a matching polls question could not be found
295             * @throws SystemException if a system exception occurred
296             */
297            @Override
298            public PollsQuestion getPollsQuestionByUuidAndGroupId(String uuid,
299                    long groupId) throws PortalException, SystemException {
300                    return pollsQuestionPersistence.findByUUID_G(uuid, groupId);
301            }
302    
303            /**
304             * Returns a range of all the polls questions.
305             *
306             * <p>
307             * 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.portlet.polls.model.impl.PollsQuestionModelImpl}. 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.
308             * </p>
309             *
310             * @param start the lower bound of the range of polls questions
311             * @param end the upper bound of the range of polls questions (not inclusive)
312             * @return the range of polls questions
313             * @throws SystemException if a system exception occurred
314             */
315            @Override
316            public List<PollsQuestion> getPollsQuestions(int start, int end)
317                    throws SystemException {
318                    return pollsQuestionPersistence.findAll(start, end);
319            }
320    
321            /**
322             * Returns the number of polls questions.
323             *
324             * @return the number of polls questions
325             * @throws SystemException if a system exception occurred
326             */
327            @Override
328            public int getPollsQuestionsCount() throws SystemException {
329                    return pollsQuestionPersistence.countAll();
330            }
331    
332            /**
333             * Updates the polls question in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
334             *
335             * @param pollsQuestion the polls question
336             * @return the polls question that was updated
337             * @throws SystemException if a system exception occurred
338             */
339            @Indexable(type = IndexableType.REINDEX)
340            @Override
341            public PollsQuestion updatePollsQuestion(PollsQuestion pollsQuestion)
342                    throws SystemException {
343                    return pollsQuestionPersistence.update(pollsQuestion);
344            }
345    
346            /**
347             * Returns the polls choice local service.
348             *
349             * @return the polls choice local service
350             */
351            public com.liferay.portlet.polls.service.PollsChoiceLocalService getPollsChoiceLocalService() {
352                    return pollsChoiceLocalService;
353            }
354    
355            /**
356             * Sets the polls choice local service.
357             *
358             * @param pollsChoiceLocalService the polls choice local service
359             */
360            public void setPollsChoiceLocalService(
361                    com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService) {
362                    this.pollsChoiceLocalService = pollsChoiceLocalService;
363            }
364    
365            /**
366             * Returns the polls choice remote service.
367             *
368             * @return the polls choice remote service
369             */
370            public com.liferay.portlet.polls.service.PollsChoiceService getPollsChoiceService() {
371                    return pollsChoiceService;
372            }
373    
374            /**
375             * Sets the polls choice remote service.
376             *
377             * @param pollsChoiceService the polls choice remote service
378             */
379            public void setPollsChoiceService(
380                    com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService) {
381                    this.pollsChoiceService = pollsChoiceService;
382            }
383    
384            /**
385             * Returns the polls choice persistence.
386             *
387             * @return the polls choice persistence
388             */
389            public PollsChoicePersistence getPollsChoicePersistence() {
390                    return pollsChoicePersistence;
391            }
392    
393            /**
394             * Sets the polls choice persistence.
395             *
396             * @param pollsChoicePersistence the polls choice persistence
397             */
398            public void setPollsChoicePersistence(
399                    PollsChoicePersistence pollsChoicePersistence) {
400                    this.pollsChoicePersistence = pollsChoicePersistence;
401            }
402    
403            /**
404             * Returns the polls question local service.
405             *
406             * @return the polls question local service
407             */
408            public com.liferay.portlet.polls.service.PollsQuestionLocalService getPollsQuestionLocalService() {
409                    return pollsQuestionLocalService;
410            }
411    
412            /**
413             * Sets the polls question local service.
414             *
415             * @param pollsQuestionLocalService the polls question local service
416             */
417            public void setPollsQuestionLocalService(
418                    com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService) {
419                    this.pollsQuestionLocalService = pollsQuestionLocalService;
420            }
421    
422            /**
423             * Returns the polls question remote service.
424             *
425             * @return the polls question remote service
426             */
427            public com.liferay.portlet.polls.service.PollsQuestionService getPollsQuestionService() {
428                    return pollsQuestionService;
429            }
430    
431            /**
432             * Sets the polls question remote service.
433             *
434             * @param pollsQuestionService the polls question remote service
435             */
436            public void setPollsQuestionService(
437                    com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService) {
438                    this.pollsQuestionService = pollsQuestionService;
439            }
440    
441            /**
442             * Returns the polls question persistence.
443             *
444             * @return the polls question persistence
445             */
446            public PollsQuestionPersistence getPollsQuestionPersistence() {
447                    return pollsQuestionPersistence;
448            }
449    
450            /**
451             * Sets the polls question persistence.
452             *
453             * @param pollsQuestionPersistence the polls question persistence
454             */
455            public void setPollsQuestionPersistence(
456                    PollsQuestionPersistence pollsQuestionPersistence) {
457                    this.pollsQuestionPersistence = pollsQuestionPersistence;
458            }
459    
460            /**
461             * Returns the polls vote local service.
462             *
463             * @return the polls vote local service
464             */
465            public com.liferay.portlet.polls.service.PollsVoteLocalService getPollsVoteLocalService() {
466                    return pollsVoteLocalService;
467            }
468    
469            /**
470             * Sets the polls vote local service.
471             *
472             * @param pollsVoteLocalService the polls vote local service
473             */
474            public void setPollsVoteLocalService(
475                    com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService) {
476                    this.pollsVoteLocalService = pollsVoteLocalService;
477            }
478    
479            /**
480             * Returns the polls vote remote service.
481             *
482             * @return the polls vote remote service
483             */
484            public com.liferay.portlet.polls.service.PollsVoteService getPollsVoteService() {
485                    return pollsVoteService;
486            }
487    
488            /**
489             * Sets the polls vote remote service.
490             *
491             * @param pollsVoteService the polls vote remote service
492             */
493            public void setPollsVoteService(
494                    com.liferay.portlet.polls.service.PollsVoteService pollsVoteService) {
495                    this.pollsVoteService = pollsVoteService;
496            }
497    
498            /**
499             * Returns the polls vote persistence.
500             *
501             * @return the polls vote persistence
502             */
503            public PollsVotePersistence getPollsVotePersistence() {
504                    return pollsVotePersistence;
505            }
506    
507            /**
508             * Sets the polls vote persistence.
509             *
510             * @param pollsVotePersistence the polls vote persistence
511             */
512            public void setPollsVotePersistence(
513                    PollsVotePersistence pollsVotePersistence) {
514                    this.pollsVotePersistence = pollsVotePersistence;
515            }
516    
517            /**
518             * Returns the counter local service.
519             *
520             * @return the counter local service
521             */
522            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
523                    return counterLocalService;
524            }
525    
526            /**
527             * Sets the counter local service.
528             *
529             * @param counterLocalService the counter local service
530             */
531            public void setCounterLocalService(
532                    com.liferay.counter.service.CounterLocalService counterLocalService) {
533                    this.counterLocalService = counterLocalService;
534            }
535    
536            /**
537             * Returns the resource local service.
538             *
539             * @return the resource local service
540             */
541            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
542                    return resourceLocalService;
543            }
544    
545            /**
546             * Sets the resource local service.
547             *
548             * @param resourceLocalService the resource local service
549             */
550            public void setResourceLocalService(
551                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
552                    this.resourceLocalService = resourceLocalService;
553            }
554    
555            /**
556             * Returns the system event local service.
557             *
558             * @return the system event local service
559             */
560            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
561                    return systemEventLocalService;
562            }
563    
564            /**
565             * Sets the system event local service.
566             *
567             * @param systemEventLocalService the system event local service
568             */
569            public void setSystemEventLocalService(
570                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
571                    this.systemEventLocalService = systemEventLocalService;
572            }
573    
574            /**
575             * Returns the system event persistence.
576             *
577             * @return the system event persistence
578             */
579            public SystemEventPersistence getSystemEventPersistence() {
580                    return systemEventPersistence;
581            }
582    
583            /**
584             * Sets the system event persistence.
585             *
586             * @param systemEventPersistence the system event persistence
587             */
588            public void setSystemEventPersistence(
589                    SystemEventPersistence systemEventPersistence) {
590                    this.systemEventPersistence = systemEventPersistence;
591            }
592    
593            /**
594             * Returns the user local service.
595             *
596             * @return the user local service
597             */
598            public com.liferay.portal.service.UserLocalService getUserLocalService() {
599                    return userLocalService;
600            }
601    
602            /**
603             * Sets the user local service.
604             *
605             * @param userLocalService the user local service
606             */
607            public void setUserLocalService(
608                    com.liferay.portal.service.UserLocalService userLocalService) {
609                    this.userLocalService = userLocalService;
610            }
611    
612            /**
613             * Returns the user remote service.
614             *
615             * @return the user remote service
616             */
617            public com.liferay.portal.service.UserService getUserService() {
618                    return userService;
619            }
620    
621            /**
622             * Sets the user remote service.
623             *
624             * @param userService the user remote service
625             */
626            public void setUserService(
627                    com.liferay.portal.service.UserService userService) {
628                    this.userService = userService;
629            }
630    
631            /**
632             * Returns the user persistence.
633             *
634             * @return the user persistence
635             */
636            public UserPersistence getUserPersistence() {
637                    return userPersistence;
638            }
639    
640            /**
641             * Sets the user persistence.
642             *
643             * @param userPersistence the user persistence
644             */
645            public void setUserPersistence(UserPersistence userPersistence) {
646                    this.userPersistence = userPersistence;
647            }
648    
649            /**
650             * Returns the user finder.
651             *
652             * @return the user finder
653             */
654            public UserFinder getUserFinder() {
655                    return userFinder;
656            }
657    
658            /**
659             * Sets the user finder.
660             *
661             * @param userFinder the user finder
662             */
663            public void setUserFinder(UserFinder userFinder) {
664                    this.userFinder = userFinder;
665            }
666    
667            public void afterPropertiesSet() {
668                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.polls.model.PollsQuestion",
669                            pollsQuestionLocalService);
670            }
671    
672            public void destroy() {
673                    persistedModelLocalServiceRegistry.unregister(
674                            "com.liferay.portlet.polls.model.PollsQuestion");
675            }
676    
677            /**
678             * Returns the Spring bean ID for this bean.
679             *
680             * @return the Spring bean ID for this bean
681             */
682            @Override
683            public String getBeanIdentifier() {
684                    return _beanIdentifier;
685            }
686    
687            /**
688             * Sets the Spring bean ID for this bean.
689             *
690             * @param beanIdentifier the Spring bean ID for this bean
691             */
692            @Override
693            public void setBeanIdentifier(String beanIdentifier) {
694                    _beanIdentifier = beanIdentifier;
695            }
696    
697            protected Class<?> getModelClass() {
698                    return PollsQuestion.class;
699            }
700    
701            protected String getModelClassName() {
702                    return PollsQuestion.class.getName();
703            }
704    
705            /**
706             * Performs an SQL query.
707             *
708             * @param sql the sql query
709             */
710            protected void runSQL(String sql) throws SystemException {
711                    try {
712                            DataSource dataSource = pollsQuestionPersistence.getDataSource();
713    
714                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
715                                            sql, new int[0]);
716    
717                            sqlUpdate.update();
718                    }
719                    catch (Exception e) {
720                            throw new SystemException(e);
721                    }
722            }
723    
724            @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceLocalService.class)
725            protected com.liferay.portlet.polls.service.PollsChoiceLocalService pollsChoiceLocalService;
726            @BeanReference(type = com.liferay.portlet.polls.service.PollsChoiceService.class)
727            protected com.liferay.portlet.polls.service.PollsChoiceService pollsChoiceService;
728            @BeanReference(type = PollsChoicePersistence.class)
729            protected PollsChoicePersistence pollsChoicePersistence;
730            @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionLocalService.class)
731            protected com.liferay.portlet.polls.service.PollsQuestionLocalService pollsQuestionLocalService;
732            @BeanReference(type = com.liferay.portlet.polls.service.PollsQuestionService.class)
733            protected com.liferay.portlet.polls.service.PollsQuestionService pollsQuestionService;
734            @BeanReference(type = PollsQuestionPersistence.class)
735            protected PollsQuestionPersistence pollsQuestionPersistence;
736            @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteLocalService.class)
737            protected com.liferay.portlet.polls.service.PollsVoteLocalService pollsVoteLocalService;
738            @BeanReference(type = com.liferay.portlet.polls.service.PollsVoteService.class)
739            protected com.liferay.portlet.polls.service.PollsVoteService pollsVoteService;
740            @BeanReference(type = PollsVotePersistence.class)
741            protected PollsVotePersistence pollsVotePersistence;
742            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
743            protected com.liferay.counter.service.CounterLocalService counterLocalService;
744            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
745            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
746            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
747            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
748            @BeanReference(type = SystemEventPersistence.class)
749            protected SystemEventPersistence systemEventPersistence;
750            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
751            protected com.liferay.portal.service.UserLocalService userLocalService;
752            @BeanReference(type = com.liferay.portal.service.UserService.class)
753            protected com.liferay.portal.service.UserService userService;
754            @BeanReference(type = UserPersistence.class)
755            protected UserPersistence userPersistence;
756            @BeanReference(type = UserFinder.class)
757            protected UserFinder userFinder;
758            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
759            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
760            private String _beanIdentifier;
761    }