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

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          public class EmployUnitBaseInfo
          {???
          ?
          ??? private long ID; //用人單位系統(tǒng)編號---邏輯主鍵
          ??? private String unitCode; //用人單位代號--業(yè)務(wù)主鍵
          }
          1、??? 使用邏輯主鍵,分頁比較方便
          2、??? 有可能unitcode會(huì)改變,用id可以保證當(dāng)unitcode改變時(shí),這個(gè)實(shí)體還存在

          {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;
          必須再添加一個(gè)屬性demandInfo,
          而在另一個(gè)畢業(yè)生申報(bào)中又要如圖上操作,,如何在service層向頁面層傳遞這些信息(測試程序員(剩2需求數(shù)))
           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 +" 需求數(shù) ";
          ????????????? }
          ?????????????
          ????????? }
          ????????? return list;
          ??? }
          }

          在action層再通過以下代碼向頁面?zhèn)鬟f數(shù)據(jù):

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



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

          雖然兩個(gè)的操作一樣,但是demandService是接口但可以執(zhí)行相應(yīng)的操作,起到黑箱子的作用。

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

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

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 辰溪县| 青铜峡市| 双城市| 大化| 宣威市| 永泰县| 夏河县| 晋江市| 龙胜| 尉犁县| 金山区| 光山县| 富宁县| 龙里县| 静宁县| 寻甸| 库尔勒市| 苏尼特右旗| 邓州市| 湘乡市| 龙游县| 宝清县| 游戏| 梁河县| 滕州市| 晋城| 平罗县| 金川县| 福贡县| 田东县| 唐山市| 林周县| 四子王旗| 西充县| 靖宇县| 襄樊市| 红安县| 山阳县| 固安县| 昌邑市| 上虞市|