Package com.tcs.hrr.service.impl

Source Code of com.tcs.hrr.service.impl.UserManagerImpl

package com.tcs.hrr.service.impl;

import java.util.List;

import com.tcs.hrr.dao.UserDAO;
import com.tcs.hrr.domain.User;
import com.tcs.hrr.service.UserManager;

public class UserManagerImpl implements UserManager {

  protected UserDAO userDao= null;
 
  public UserDAO getUserDao() {
    return userDao;
  }

  public void setUserDao(UserDAO userDao) {
    this.userDao = userDao;
  }

  @Override
  public User findUserById(Integer id) {
    // TODO Auto-generated method stub
    return userDao.findById(id);
  }

  @Override
  public int insertUser() {
    User user  = new User();
      user.setName("test2");
      userDao.save(user);
    return 0;
  }
 
  @Override
  public void mergeUser(User user) {
    this.userDao.merge(user);
  }

  @Override
  public List findUserByNameAndPwd(String username, String password) {
    String stringQuery = "from User user where user.name='"+username+"' and user.password='"+password+"'";
    return this.userDao.findBySQL(stringQuery);
  }

}
TOP

Related Classes of com.tcs.hrr.service.impl.UserManagerImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.