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.PollsChoice;
032: import com.liferay.portlet.polls.model.impl.PollsChoiceImpl;
033: import com.liferay.portlet.polls.service.PollsChoiceLocalService;
034: import com.liferay.portlet.polls.service.PollsQuestionLocalService;
035: import com.liferay.portlet.polls.service.PollsQuestionLocalServiceFactory;
036: import com.liferay.portlet.polls.service.PollsQuestionService;
037: import com.liferay.portlet.polls.service.PollsQuestionServiceFactory;
038: import com.liferay.portlet.polls.service.PollsVoteLocalService;
039: import com.liferay.portlet.polls.service.PollsVoteLocalServiceFactory;
040: import com.liferay.portlet.polls.service.PollsVoteService;
041: import com.liferay.portlet.polls.service.PollsVoteServiceFactory;
042: import com.liferay.portlet.polls.service.persistence.PollsChoiceFinder;
043: import com.liferay.portlet.polls.service.persistence.PollsChoiceFinderUtil;
044: import com.liferay.portlet.polls.service.persistence.PollsChoicePersistence;
045: import com.liferay.portlet.polls.service.persistence.PollsChoiceUtil;
046: import com.liferay.portlet.polls.service.persistence.PollsQuestionPersistence;
047: import com.liferay.portlet.polls.service.persistence.PollsQuestionUtil;
048: import com.liferay.portlet.polls.service.persistence.PollsVotePersistence;
049: import com.liferay.portlet.polls.service.persistence.PollsVoteUtil;
050:
051: import org.springframework.beans.factory.InitializingBean;
052:
053: import java.util.List;
054:
055: /**
056: * <a href="PollsChoiceLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
057: *
058: * @author Brian Wing Shun Chan
059: *
060: */
061: public abstract class PollsChoiceLocalServiceBaseImpl implements
062: PollsChoiceLocalService, InitializingBean {
063: public PollsChoice addPollsChoice(PollsChoice model)
064: throws SystemException {
065: PollsChoice pollsChoice = new PollsChoiceImpl();
066:
067: pollsChoice.setNew(true);
068:
069: pollsChoice.setUuid(model.getUuid());
070: pollsChoice.setChoiceId(model.getChoiceId());
071: pollsChoice.setQuestionId(model.getQuestionId());
072: pollsChoice.setName(model.getName());
073: pollsChoice.setDescription(model.getDescription());
074:
075: return pollsChoicePersistence.update(pollsChoice);
076: }
077:
078: public List dynamicQuery(DynamicQueryInitializer queryInitializer)
079: throws SystemException {
080: return pollsChoicePersistence
081: .findWithDynamicQuery(queryInitializer);
082: }
083:
084: public List dynamicQuery(DynamicQueryInitializer queryInitializer,
085: int begin, int end) throws SystemException {
086: return pollsChoicePersistence.findWithDynamicQuery(
087: queryInitializer, begin, end);
088: }
089:
090: public PollsChoice updatePollsChoice(PollsChoice model)
091: throws SystemException {
092: return pollsChoicePersistence.update(model, true);
093: }
094:
095: public PollsChoicePersistence getPollsChoicePersistence() {
096: return pollsChoicePersistence;
097: }
098:
099: public void setPollsChoicePersistence(
100: PollsChoicePersistence pollsChoicePersistence) {
101: this .pollsChoicePersistence = pollsChoicePersistence;
102: }
103:
104: public PollsChoiceFinder getPollsChoiceFinder() {
105: return pollsChoiceFinder;
106: }
107:
108: public void setPollsChoiceFinder(PollsChoiceFinder pollsChoiceFinder) {
109: this .pollsChoiceFinder = pollsChoiceFinder;
110: }
111:
112: public PollsQuestionLocalService getPollsQuestionLocalService() {
113: return pollsQuestionLocalService;
114: }
115:
116: public void setPollsQuestionLocalService(
117: PollsQuestionLocalService pollsQuestionLocalService) {
118: this .pollsQuestionLocalService = pollsQuestionLocalService;
119: }
120:
121: public PollsQuestionService getPollsQuestionService() {
122: return pollsQuestionService;
123: }
124:
125: public void setPollsQuestionService(
126: PollsQuestionService pollsQuestionService) {
127: this .pollsQuestionService = pollsQuestionService;
128: }
129:
130: public PollsQuestionPersistence getPollsQuestionPersistence() {
131: return pollsQuestionPersistence;
132: }
133:
134: public void setPollsQuestionPersistence(
135: PollsQuestionPersistence pollsQuestionPersistence) {
136: this .pollsQuestionPersistence = pollsQuestionPersistence;
137: }
138:
139: public PollsVoteLocalService getPollsVoteLocalService() {
140: return pollsVoteLocalService;
141: }
142:
143: public void setPollsVoteLocalService(
144: PollsVoteLocalService pollsVoteLocalService) {
145: this .pollsVoteLocalService = pollsVoteLocalService;
146: }
147:
148: public PollsVoteService getPollsVoteService() {
149: return pollsVoteService;
150: }
151:
152: public void setPollsVoteService(PollsVoteService pollsVoteService) {
153: this .pollsVoteService = pollsVoteService;
154: }
155:
156: public PollsVotePersistence getPollsVotePersistence() {
157: return pollsVotePersistence;
158: }
159:
160: public void setPollsVotePersistence(
161: PollsVotePersistence pollsVotePersistence) {
162: this .pollsVotePersistence = pollsVotePersistence;
163: }
164:
165: public CounterLocalService getCounterLocalService() {
166: return counterLocalService;
167: }
168:
169: public void setCounterLocalService(
170: CounterLocalService counterLocalService) {
171: this .counterLocalService = counterLocalService;
172: }
173:
174: public CounterService getCounterService() {
175: return counterService;
176: }
177:
178: public void setCounterService(CounterService counterService) {
179: this .counterService = counterService;
180: }
181:
182: public void afterPropertiesSet() {
183: if (pollsChoicePersistence == null) {
184: pollsChoicePersistence = PollsChoiceUtil.getPersistence();
185: }
186:
187: if (pollsChoiceFinder == null) {
188: pollsChoiceFinder = PollsChoiceFinderUtil.getFinder();
189: }
190:
191: if (pollsQuestionLocalService == null) {
192: pollsQuestionLocalService = PollsQuestionLocalServiceFactory
193: .getImpl();
194: }
195:
196: if (pollsQuestionService == null) {
197: pollsQuestionService = PollsQuestionServiceFactory
198: .getImpl();
199: }
200:
201: if (pollsQuestionPersistence == null) {
202: pollsQuestionPersistence = PollsQuestionUtil
203: .getPersistence();
204: }
205:
206: if (pollsVoteLocalService == null) {
207: pollsVoteLocalService = PollsVoteLocalServiceFactory
208: .getImpl();
209: }
210:
211: if (pollsVoteService == null) {
212: pollsVoteService = PollsVoteServiceFactory.getImpl();
213: }
214:
215: if (pollsVotePersistence == null) {
216: pollsVotePersistence = PollsVoteUtil.getPersistence();
217: }
218:
219: if (counterLocalService == null) {
220: counterLocalService = CounterLocalServiceFactory.getImpl();
221: }
222:
223: if (counterService == null) {
224: counterService = CounterServiceFactory.getImpl();
225: }
226: }
227:
228: protected PollsChoicePersistence pollsChoicePersistence;
229: protected PollsChoiceFinder pollsChoiceFinder;
230: protected PollsQuestionLocalService pollsQuestionLocalService;
231: protected PollsQuestionService pollsQuestionService;
232: protected PollsQuestionPersistence pollsQuestionPersistence;
233: protected PollsVoteLocalService pollsVoteLocalService;
234: protected PollsVoteService pollsVoteService;
235: protected PollsVotePersistence pollsVotePersistence;
236: protected CounterLocalService counterLocalService;
237: protected CounterService counterService;
238: }
|