📄 logindao.java
字号:
// ----------------------------------------------------------
// $Id: $
// Copyright (c) SHSAFE 2005-2006. All Rights Reserved.
// ----------------------------------------------------------
package example.login;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import com.shsafe.common.database.DatabaseConnection;
import example.common.dao.ExampleDAO;
import example.common.dto.UserDTO;
/**
* @author Michael J Chane
* @version $Revision: $ $Date: $
*/
public class LoginDAO extends ExampleDAO {
/**
* Creates a new <code>LoginDAO</code> object.
*
* @param connection
* @throws SQLException
*/
public LoginDAO(DatabaseConnection connection) throws SQLException {
super(connection);
}
/**
*
* @param userId
* @return User
* @throws SQLException
*/
public UserDTO findByPrimaryKey(String userId) throws SQLException {
Map<String, Object> param = new HashMap<String, Object>();
param.put("userId", userId);
Map<String, Object> data = find("findByPrimaryKey", param);
if (data == null) {
return null;
}
UserDTO user = new UserDTO();
user.populate(data);
return user;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -