📄 userssessionbean.java
字号:
/*
*
* 开发时间:2004-08-20 at 05:40:07
*
* 作者:曹广鑫
*
* 网站:www.helpsoft.org 电子邮件:support@helpsoft.org
*/
package org.helpsoft.blog.j2ee.session;
import org.helpsoft.blog.factory.*;
import org.helpsoft.blog.dao.*;
import org.helpsoft.blog.dto.*;
import org.helpsoft.blog.exceptions.*;
import java.rmi.RemoteException;
import java.math.*;
import java.util.Date;
import javax.ejb.*;
public class UsersSessionBean implements SessionBean
{
private UsersDao daoImpl = createDao();
/**
* Inserts a new row in the users table.
*/
public UsersPk insert(Users dto) throws UsersDaoException
{
try {
return daoImpl.insert(dto);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Updates a single row in the users table.
*/
public void update(UsersPk pk, Users dto) throws UsersDaoException
{
try {
daoImpl.update(pk, dto);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Deletes a single row in the users table.
*/
public void delete(UsersPk pk) throws UsersDaoException
{
try {
daoImpl.delete(pk);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Returns the rows from the users table that matches the specified primary-key value.
*/
public Users findByPrimaryKey(UsersPk pk) throws UsersDaoException
{
return findByPrimaryKey( pk.getUserid() );
}
/**
* Method 'findAll'
*
* @throws UsersDaoException
* @return Users[]
*/
public Users[] findAll() throws UsersDaoException
{
try {
return daoImpl.findAll();
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'findWhereUseridEquals'
*
* @param userid
* @throws UsersDaoException
* @return Users[]
*/
public Users[] findWhereUseridEquals(String userid) throws UsersDaoException
{
try {
return daoImpl.findWhereUseridEquals(userid);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'findWhereNameEquals'
*
* @param name
* @throws UsersDaoException
* @return Users[]
*/
public Users[] findWhereNameEquals(String name) throws UsersDaoException
{
try {
return daoImpl.findWhereNameEquals(name);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'findByPrimaryKey'
*
* @param userid
* @throws UsersDaoException
* @return Users
*/
public Users findByPrimaryKey(String userid) throws UsersDaoException
{
try {
return daoImpl.findByPrimaryKey(userid);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'findByDynamicSelect'
*
* @param sql
* @param arg
* @throws UsersDaoException
* @return Users[]
*/
public Users[] findByDynamicSelect(String sql, Object[] arg) throws UsersDaoException
{
try {
return daoImpl.findByDynamicSelect(sql, arg);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'findByDynamicWhere'
*
* @param sql
* @param arg
* @throws UsersDaoException
* @return Users[]
*/
public Users[] findByDynamicWhere(String sql, Object[] arg) throws UsersDaoException
{
try {
return daoImpl.findByDynamicWhere(sql, arg);
}
catch (UsersDaoException daoException) {
throw daoException;
}
catch (Exception ex) {
ex.printStackTrace();
throw new UsersDaoException( ex.getMessage() );
}
}
/**
* Method 'ejbActivate'
*
*/
public void ejbActivate()
{
}
/**
* Method 'ejbPassivate'
*
*/
public void ejbPassivate()
{
}
/**
* Method 'ejbCreate'
*
*/
public void ejbCreate()
{
}
/**
* Method 'ejbRemove'
*
*/
public void ejbRemove()
{
}
/**
* Method 'setSessionContext'
*
* @param ctx
*/
public void setSessionContext(SessionContext ctx)
{
}
/**
* Method 'unsetSessionContext'
*
*/
public void unsetSessionContext()
{
}
/**
* Method 'createDao'
*
* @return UsersDao
*/
private UsersDao createDao()
{
return UsersDaoFactory.create();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -