?? accountbo.java
字號:
package com.icome.bo;
import java.util.Date;
import java.util.List;
import com.icome.dao.*;
import com.icome.entity.*;
import com.icome.dalfactory.*;
public class AccountBO {
private static final AccountDAO accountdao = DataAccess.createAccountDAO();
public boolean save(Account transientInstance)
{
try
{
accountdao.save(transientInstance);
return true;
}catch(Exception e)
{
e.printStackTrace();
return false;
}
}
public boolean delete(Account persistentInstance)
{
try{
accountdao.delete(persistentInstance);
return true;
}catch(Exception e)
{
return false;
}
}
public boolean delete(String uid)
{
try
{
Account account = accountdao.findById(uid);
return this.delete(account);
}catch(Exception e)
{
return false;
}
}
/**
* Load the user account info by user id(uid)
* @param uid
* @return the instance of the Account if ok
* @return null if load failed
*/
public Account retrieve(String uid)
{
try
{
return accountdao.findById(uid);
}catch(Exception e)
{
return null;
}
}
/**
* used for the account login
* @param uid
* @param pwd
* @return true if login success
* @return false if login failed
*/
public boolean login(String uid,String pwd)
{
try
{
return accountdao.login(uid, pwd);
}catch(Exception e)
{
return false;
}
}
public Account findById( java.lang.String id)
{
try
{
return accountdao.findById(id);
}
catch(Exception e)
{
return null;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -