隨筆 - 23  文章 - 3  trackbacks - 0
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          public class EmployUnitBaseInfo
          {???
          ?
          ??? private long ID; //用人單位系統編號---邏輯主鍵
          ??? private String unitCode; //用人單位代號--業務主鍵
          }
          1、??? 使用邏輯主鍵,分頁比較方便
          2、??? 有可能unitcode會改變,用id可以保證當unitcode改變時,這個實體還存在

          {C5A4CCF8-A282-4700-A5F3-FA6A5246D9F2}0.jpg

          在頁面上必須返回workpost + demandid,,
          pojo 中的demand類如下:只有以下屬性的setter和getter
          ??? private String usedNeedNum;
          ??? private int unitId;
          ??? private String demandInfo;
           private long ID;
          ??? private String needNum;
          ??? private String position;
          必須再添加一個屬性demandInfo,
          而在另一個畢業生申報中又要如圖上操作,,如何在service層向頁面層傳遞這些信息(測試程序員(剩2需求數))
           public class DemandServiceImpl
          ??? extends BaseServiceImpl implements DemandService{
          ??? public List getDemandList(int unitId)
          ??? {
          ????????? long demandId;
          ????????? int needNum;
          ????????? int usedNeedNum;
          ????????? int lastNum;
          ?????????
          ????????? String demandInfo;
          ????????? TRealDemandDAOImpl dao = (TRealDemandDAOImpl) this.getBaseDAO();
          ????????? List list = dao.getSpareDemandByUnitId(unitId);
          ????????? Iterator it = list.iterator();
          ????????? while(it.hasNext())
          ????????? {
          ????????????? TRealDemand demand = (TRealDemand) it.next();
          ????????????? demandId = demand.getID();
          ????????????? needNum =? Integer.parseInt(demand.getNeedNum());?
          ????????????? usedNeedNum = Integer.parseInt(demand.getUsedNeedNum());
          ????????????? if(needNum>usedNeedNum)
          ????????????? {
          ????????????????? lastNum = usedNeedNum-needNum;
          ????????????????? demandInfo = demand.getPosition()+" 剩 " + lastNum +" 需求數 ";
          ????????????? }
          ?????????????
          ????????? }
          ????????? return list;
          ??? }
          }

          在action層再通過以下代碼向頁面傳遞數據:

          DemandService demandService = (DemandService) this.getBean("DemandService");
          ?request.setAttribute("demandList",demandService.findDemandListByUnitId(unitInfo.getID()));



          4、注意DemandServiceImpl 是實現類,DemandService 是interface
          DemandService demandService = (DemandService) this.getBean("DemandService");
          和DemandServiceImpl demandService = (DemandServiceImpl) this.getBean("DemandService");

          雖然兩個的操作一樣,但是demandService是接口但可以執行相應的操作,起到黑箱子的作用。

          5、記得在action中添加一個實體時,要通過idcard取得sex和birthday的屬性加到內存中(表相對應的pojo)

          posted on 2006-04-21 10:36 aimy 閱讀(101) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 察哈| 富川| 轮台县| 分宜县| 延吉市| 怀远县| 大理市| 商河县| 昭苏县| 桃园县| 嘉祥县| 兴业县| 太白县| 明溪县| 东方市| 祥云县| 上栗县| 襄樊市| 沙洋县| 定陶县| 始兴县| 临清市| 乐安县| 亳州市| 太和县| 徐闻县| 黑河市| 饶河县| 陇南市| 临澧县| 浮山县| 布尔津县| 金沙县| 柳江县| 沿河| 肇东市| 辽阳县| 会同县| 富宁县| 壶关县| 松溪县|