⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acounttabledao.java

📁 hibernate应用测试,初学hibernate 的会员可以看看.
💻 JAVA
字号:
package com.dao;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.common.resources.Resources;

import java.io.Reader;
import java.io.IOException;
import java.util.List;
import java.sql.SQLException;

import com.tool.pagetool.*;
import com.bean.*;
public class AcountTableDAO extends PageDAO{
    public static List selectAllAcountTable() throws SQLException {
        return sqlMapper.queryForList("selectAllAcountTable");
   }

   public static AcountTable selectAcountTableByacountId(int id) throws SQLException {
       return (AcountTable) sqlMapper.queryForObject("selectAcountTableByacountId",       new Integer(id));
   }

   public static void updateDelFlagByAcountId(AcountTable acountTable)throws SQLException{
       sqlMapper.update("updateDelFlagByAcountId",acountTable);
   }
   public static AccountAndGroup selectAcountAndGroupByAcountNAndP(AcountTable acountTable)throws SQLException{
       return (AccountAndGroup)sqlMapper.queryForObject("selectAcountAndGroupByAcountNAndP",acountTable);
   }

   public static AcountTable selectAcountRealPeopleId(int acountId)throws SQLException {
     return  (AcountTable)sqlMapper.queryForObject("selectAcountRealPeopleId",new Integer(acountId));
   }

   public static int updateOpenFlagByAcountId(AcountTable acountTable)throws SQLException{
     return  sqlMapper.update("updateOpenFlagByAcountId",acountTable);
   }

   public static AccountAndGroup selectAcountAndGroupByAcountId(int acountId)throws SQLException {
       return (AccountAndGroup)sqlMapper.queryForObject("selectAcountAndGroupByAcountId",new Integer(acountId));
   }

   public static void insertAcountTable(AcountTable acounttable) throws SQLException {
      sqlMapper.insert("insertAcountTable", acounttable);
   }

   public static void updateAcountTable(AcountTable acounttable) throws SQLException {
       sqlMapper.update("updateAcountTable", acounttable);
   }

   public static void updateNameAndPwd(AcountTable acountId)throws SQLException{
       sqlMapper.update("updateNameAndPwd", acountId);
   }

   public static void deleteAcountTableByacountId(int id) throws SQLException {
        sqlMapper.delete("deleteAcountTableByacountId", new Integer(id));
    }

    public static boolean selectIsHasAccountName(String accountName) throws
            SQLException {
        Object obj = sqlMapper.queryForObject("selectIsHasAcountName",
                                              accountName);
        if (obj == null)return false; //用户名存在
        else return true; //用户名不存在
    }

    public static List selectAccountAndGroupByGroupId(int
            groupId) throws SQLException {
        return sqlMapper.queryForList("selectAcountAndGroupByGroupId",
                                              new Integer(groupId));
    }

    public static List selectAllAccountAndGroupForPage(Page page) throws SQLException {
        Object obj = sqlMapper.queryForObject("selectAllAcountAndGroup",page);
        return (List) obj;
    }


    public int selectCount(Page page) throws SQLException {
        return ((Integer) sqlMapper.queryForObject("selectAcountTableCount",
                page)).intValue();
    }

   public int selectCount() throws SQLException{
        return ((Integer)sqlMapper.queryForObject("selectAcountTableCountNotP")).intValue();
    }

   public List selectForPage(Page page) throws SQLException{
        List pageList = sqlMapper.queryForList("selectAcountTableForPage",page);
        return pageList;
    }

   public static void startTransation()throws SQLException{
        sqlMapper.startTransaction();
    }

     public static void startTransation(int i)throws SQLException{
        sqlMapper.startTransaction(i);
     }

   public static void rollback() throws SQLException{
        sqlMapper.endTransaction();
     }

   public static void commit()throws SQLException{
        sqlMapper.commitTransaction();
    }

  public static int getLastId() throws SQLException{
       Object obj = sqlMapper.queryForObject("selectAcountTableLastId");
       if(obj==null) return 0;
       else
       return ((Integer)obj).intValue();
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -