1
22
23 package com.liferay.portlet.polls.service.base;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
27
28 import com.liferay.portlet.polls.model.PollsChoice;
29 import com.liferay.portlet.polls.model.impl.PollsChoiceImpl;
30 import com.liferay.portlet.polls.service.PollsChoiceLocalService;
31 import com.liferay.portlet.polls.service.persistence.PollsChoiceUtil;
32
33 import java.util.List;
34
35
41 public abstract class PollsChoiceLocalServiceBaseImpl
42 implements PollsChoiceLocalService {
43 public PollsChoice addPollsChoice(PollsChoice model)
44 throws SystemException {
45 PollsChoice pollsChoice = new PollsChoiceImpl();
46 pollsChoice.setNew(true);
47 pollsChoice.setChoiceId(model.getChoiceId());
48 pollsChoice.setQuestionId(model.getQuestionId());
49 pollsChoice.setName(model.getName());
50 pollsChoice.setDescription(model.getDescription());
51
52 return PollsChoiceUtil.update(pollsChoice);
53 }
54
55 public List dynamicQuery(DynamicQueryInitializer queryInitializer)
56 throws SystemException {
57 return PollsChoiceUtil.findWithDynamicQuery(queryInitializer);
58 }
59
60 public List dynamicQuery(DynamicQueryInitializer queryInitializer,
61 int begin, int end) throws SystemException {
62 return PollsChoiceUtil.findWithDynamicQuery(queryInitializer, begin, end);
63 }
64
65 public PollsChoice updatePollsChoice(PollsChoice model)
66 throws SystemException {
67 PollsChoice pollsChoice = new PollsChoiceImpl();
68 pollsChoice.setNew(false);
69 pollsChoice.setChoiceId(model.getChoiceId());
70 pollsChoice.setQuestionId(model.getQuestionId());
71 pollsChoice.setName(model.getName());
72 pollsChoice.setDescription(model.getDescription());
73
74 return PollsChoiceUtil.update(pollsChoice);
75 }
76 }