隨筆 - 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)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 积石山| 玉门市| 苍梧县| 乾安县| 沧州市| 天柱县| 余姚市| 桂阳县| 新民市| 安龙县| 长阳| 滦南县| 河南省| 天等县| 中西区| 临城县| 鄱阳县| 获嘉县| 安化县| 大理市| 泾川县| 屏山县| 内乡县| 嘉兴市| 丰镇市| 东乡| 旅游| 仁寿县| 浑源县| 温泉县| 新龙县| 公主岭市| 清涧县| 广宗县| 广东省| 成安县| 德安县| 会东县| 永靖县| 兰溪市| 登封市|