001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.polls.service.base;
022:
023: import com.liferay.counter.service.CounterLocalService;
024: import com.liferay.counter.service.CounterLocalServiceFactory;
025: import com.liferay.counter.service.CounterService;
026: import com.liferay.counter.service.CounterServiceFactory;
027:
028: import com.liferay.portal.SystemException;
029: import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
030:
031: import com.liferay.portlet.polls.model.PollsVote;
032: import com.liferay.portlet.polls.model.impl.PollsVoteImpl;
033: import com.liferay.portlet.polls.service.PollsChoiceLocalService;
034: import com.liferay.portlet.polls.service.PollsChoiceLocalServiceFactory;
035: import com.liferay.portlet.polls.service.PollsQuestionLocalService;
036: import com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory;
037: import com.liferay.portlet.polls.service.PollsQuestionService;
038: import com.liferay.portlet.polls.service.PollsQuestionServiceFactory;
039: import com.liferay.portlet.polls.service.PollsVoteLocalService;
040: import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
041: import com.liferay.portlet.polls.service.persistence.PollsChoiceFinderUtil;
042: import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
043: import com.liferay.portlet.polls.service.persistence.PollsChoiceUtil;
044: import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
045: import com.liferay.portlet.polls.service.persistence.PollsQuestionUtil;
046: import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
047: import com.liferay.portlet.polls.service.persistence.PollsVoteUtil;
048:
049: import org.springframework.beans.factory.InitializingBean;
050:
051: import java.util.List;
052:
053: /**
054: * <a href="PollsVoteLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
055: *
056: * @author Brian Wing Shun Chan
057: *
058: */
059: public abstract class PollsVoteLocalServiceBaseImpl implements
060: PollsVoteLocalService, InitializingBean {
061: public PollsVote addPollsVote(PollsVote model)
062: throws SystemException {
063: PollsVote pollsVote = new PollsVoteImpl();
064:
065: pollsVote.setNew(true);
066:
067: pollsVote.setVoteId(model.getVoteId());
068: pollsVote.setUserId(model.getUserId());
069: pollsVote.setQuestionId(model.getQuestionId());
070: pollsVote.setChoiceId(model.getChoiceId());
071: pollsVote.setVoteDate(model.getVoteDate());
072:
073: return pollsVotePersistence.update(pollsVote);
074: }
075:
076: public List dynamicQuery(DynamicQueryInitializer queryInitializer)
077: throws SystemException {
078: return pollsVotePersistence
079: .findWithDynamicQuery(queryInitializer);
080: }
081:
082: public List dynamicQuery(DynamicQueryInitializer queryInitializer,
083: int begin, int end) throws SystemException {
084: return pollsVotePersistence.findWithDynamicQuery(
085: queryInitializer, begin, end);
086: }
087:
088: public PollsVote updatePollsVote(PollsVote model)
089: throws SystemException {
090: return pollsVotePersistence.update(model, true);
091: }
092:
093: public PollsChoiceLocalService getPollsChoiceLocalService() {
094: return pollsChoiceLocalService;
095: }
096:
097: public void setPollsChoiceLocalService(
098: PollsChoiceLocalService pollsChoiceLocalService) {
099: this .pollsChoiceLocalService = pollsChoiceLocalService;
100: }
101:
102: public PollsChoicePersistence getPollsChoicePersistence() {
103: return pollsChoicePersistence;
104: }
105:
106: public void setPollsChoicePersistence(
107: PollsChoicePersistence pollsChoicePersistence) {
108: this .pollsChoicePersistence = pollsChoicePersistence;
109: }
110:
111: public PollsChoiceFinder getPollsChoiceFinder() {
112: return pollsChoiceFinder;
113: }
114:
115: public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
116: this .pollsChoiceFinder = pollsChoiceFinder;
117: }
118:
119: public PollsQuestionLocalService getPollsQuestionLocalService() {
120: return pollsQuestionLocalService;
121: }
122:
123: public void setPollsQuestionLocalService(
124: PollsQuestionLocalService pollsQuestionLocalService) {
125: this .pollsQuestionLocalService = pollsQuestionLocalService;
126: }
127:
128: public PollsQuestionService getPollsQuestionService() {
129: return pollsQuestionService;
130: }
131:
132: public void setPollsQuestionService(
133: PollsQuestionService pollsQuestionService) {
134: this .pollsQuestionService = pollsQuestionService;
135: }
136:
137: public PollsQuestionPersistence getPollsQuestionPersistence() {
138: return pollsQuestionPersistence;
139: }
140:
141: public void setPollsQuestionPersistence(
142: PollsQuestionPersistence pollsQuestionPersistence) {
143: this .pollsQuestionPersistence = pollsQuestionPersistence;
144: }
145:
146: public PollsVotePersistence getPollsVotePersistence() {
147: return pollsVotePersistence;
148: }
149:
150: public void setPollsVotePersistence(
151: PollsVotePersistence pollsVotePersistence) {
152: this .pollsVotePersistence = pollsVotePersistence;
153: }
154:
155: public CounterLocalService getCounterLocalService() {
156: return counterLocalService;
157: }
158:
159: public void setCounterLocalService(
160: CounterLocalService counterLocalService) {
161: this .counterLocalService = counterLocalService;
162: }
163:
164: public CounterService getCounterService() {
165: return counterService;
166: }
167:
168: public void setCounterService(CounterService counterService) {
169: this .counterService = counterService;
170: }
171:
172: public void afterPropertiesSet() {
173: if (pollsChoiceLocalService == null) {
174: pollsChoiceLocalService = PollsChoiceLocalServiceFactory
175: .getImpl();
176: }
177:
178: if (pollsChoicePersistence == null) {
179: pollsChoicePersistence = PollsChoiceUtil.getPersistence();
180: }
181:
182: if (pollsChoiceFinder == null) {
183: pollsChoiceFinder = PollsChoiceFinderUtil.getFinder();
184: }
185:
186: if (pollsQuestionLocalService == null) {
187: pollsQuestionLocalService = PollsQuestionLocalServiceFactory
188: .getImpl();
189: }
190:
191: if (pollsQuestionService == null) {
192: pollsQuestionService = PollsQuestionServiceFactory
193: .getImpl();
194: }
195:
196: if (pollsQuestionPersistence == null) {
197: pollsQuestionPersistence = PollsQuestionUtil
198: .getPersistence();
199: }
200:
201: if (pollsVotePersistence == null) {
202: pollsVotePersistence = PollsVoteUtil.getPersistence();
203: }
204:
205: if (counterLocalService == null) {
206: counterLocalService = CounterLocalServiceFactory.getImpl();
207: }
208:
209: if (counterService == null) {
210: counterService = CounterServiceFactory.getImpl();
211: }
212: }
213:
214: protected PollsChoiceLocalService pollsChoiceLocalService;
215: protected PollsChoicePersistence pollsChoicePersistence;
216: protected PollsChoiceFinder pollsChoiceFinder;
217: protected PollsQuestionLocalService pollsQuestionLocalService;
218: protected PollsQuestionService pollsQuestionService;
219: protected PollsQuestionPersistence pollsQuestionPersistence;
220: protected PollsVotePersistence pollsVotePersistence;
221: protected CounterLocalService counterLocalService;
222: protected CounterService counterService;
223: }
|