The classes in the net.devmanuals.service.serviceImpl package implements the interfaces defined in net.devmanuals.service package
Package net.devmanuals.service.serviceImpl
The classes in the net.devmanuals.service.serviceImpl package implements the interfaces defined in net.devmanuals.service package to call function defined in the classes of net.devmanuals.dao.daoImpl package.
The structure of the net.devmanuals.service.serviceImpl package and code of each class with description is given below :
AdminServiceImpl.java
This class is used to call function defined in AdminDaoImpl class.
package net.devmanuals.service.serviceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import net.devmanuals.dao.AdminDao; import net.devmanuals.model.Admin; import net.devmanuals.service.AdminService; @Service("adminService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class AdminServiceImpl implements AdminService { @Autowired private AdminDao adminDao; @Override public List<Admin> validateLoginAdmin(String adminEmail, String password) { return adminDao.validateLoginAdmin(adminEmail, password); } @Override public List<Admin> getAdminByAdminEmail(String adminEmail) { return adminDao.getAdminByAdminEmail(adminEmail); } }
LanguageServiceImpl.java
This class is used to call function defined in LanguageDaoImpl class.
package net.devmanuals.service.serviceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import net.devmanuals.dao.LanguageDao; import net.devmanuals.model.Language; import net.devmanuals.service.LanguageService; @Service("languageService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class LanguageServiceImpl implements LanguageService { @Autowired private LanguageDao languageDao; public List<Language> listLanguages(){ return languageDao.listLanguages(); } public List<Language> getLanguageByLanguageId(Long languageId){ return languageDao.getLanguageByLanguageId(languageId); } }
QuestionOptionsServiceImpl.java
This class is used to call function defined in QuestionOptionsDaoImpl class.
package net.devmanuals.service.serviceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import net.devmanuals.dao.QuestionOptionsDao; import net.devmanuals.model.QuestionOptions; import net.devmanuals.service.QuestionOptionsService; @Service("questionOptionsService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class QuestionOptionsServiceImpl implements QuestionOptionsService { @Autowired private QuestionOptionsDao questionOptionsDao; @Override public List<QuestionOptions> listQuestionOptions() { return questionOptionsDao.listQuestionOptions(); } @Override public List<QuestionOptions> getQuestionOptionsByQuestionId(Long questionId){ return questionOptionsDao.getQuestionOptionsByQuestionId(questionId); } @Override public List<QuestionOptions> getQuestionOptionsByQuesOpId(Long quesOpId){ return questionOptionsDao.getQuestionOptionsByQuesOpId(quesOpId); } @Override public void saveQuestionOptions(QuestionOptions questionOptions){ questionOptionsDao.saveQuestionOptions(questionOptions); } @Override public void updateQuestionOptions(QuestionOptions questionOptions){ questionOptionsDao.updateQuestionOptions(questionOptions); } @Override public void deleteQuestionOptionsByQuestionId(Long questionId){ questionOptionsDao.deleteQuestionOptionsByQuestionId(questionId); } }
QuestionsServiceImpl.java
This class is used to call function defined in QuestionsDaoImpl class.
package net.devmanuals.service.serviceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import net.devmanuals.dao.QuestionsDao; import net.devmanuals.model.Questions; import net.devmanuals.service.QuestionsService; @Service("questionsService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class QuestionsServiceImpl implements QuestionsService { @Autowired private QuestionsDao questionsDao; @Override public List<Questions> listQuestions(){ return questionsDao.listQuestions(); } @Override public List<Questions> getQuestionsByLanguageId(Long languageId){ return questionsDao.getQuestionsByLanguageId(languageId); } @Override public List<Questions> getQuestionsByQuestionId(Long questionId){ return questionsDao.getQuestionsByQuestionId(questionId); } @Override public void saveQuestions(Questions questions){ questionsDao.saveQuestions(questions); } @Override public void updateQuestions(Questions questions){ questionsDao.updateQuestions(questions); } @Override public void deleteQuestions(Questions questions){ questionsDao.deleteQuestions(questions); } @Override public List<Questions> getTenRandomQuestionsByLanguageId(Long languageId){ return questionsDao.getTenRandomQuestionsByLanguageId(languageId); } }
UserServiceImpl.java
This class is used to call function defined in UserDaoImpl class.
package net.devmanuals.service.serviceImpl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import net.devmanuals.dao.UserDao; import net.devmanuals.model.User; import net.devmanuals.service.UserService; @Service("userService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class UserServiceImpl implements UserService { @Autowired private UserDao userDao; @Override public List<User> listUsers() { return userDao.listUsers(); } @Override public void saveUser(User user){ userDao.saveUser(user); } @Override public List<User> getUserByUserEmail(String userEmail){ return userDao.getUserByUserEmail(userEmail); } @Override public List<User> validateLoginUser(String userEmail,String password){ return userDao.validateLoginUser(userEmail, password); } }
[ 0 ] Comments