[Seasar-user:1682] Re: Service 実装クラスから Dao を呼ぶ
Masanobu Shimura
mikeshimura
2005年 3月 26日 (土) 21:02:04 JST
$BF#;3$5$^(B
$BG0$N$?$a2<5-#2E@$r3NG'$7$F$_$F2<$5$$!#(B
$B#1!%(BopHistoryDao$B$O(B Interface$B$G$9$h$M!#(B
$B#2!%(BService$B<BAu%/%i%9$N @ _Dj$r$7$F$$$k(B Dicon$B$K!!(BopHistoryDao$B$N(B
$B!!!!(BComponent$B @ _Dj$,4^$^$l$F$$$k$+!"$"$k$$$O(B include$B$G @ _Dj$7$F$$$k(B
$B!!!!(BDicon$B$,8F$P$l$F$^$9$h$M!#(B
$B;d$N7P83$+$i;29M$^$G!#(B
$B;VB<(B
--- yamafuji yama <yamafujiyamajp @ yahoo.co.jp> $B$+$i$N%a%C%;!<%8!'(B
>
> $BF#;3$G$9!#(B
>
> struts + dao$B$N<BAu$r$7$F$$$^$9!#(B
> $B%\%?%s2!2<$G(BAction$B%/%i%9$+$i(BService$B<BAu%/%i%9$r8F$S!"(B
> Service$B<BAu%/%i%9$+$i(BDao$B$r8F$V$3$H$G!"(BDB$B$+$iCM$r<hF@$9$k$H$$$C$?(B
> $B7A$r9M$($F$$$^$9!#(B
> $B<B:]$N<BAu$O0J2<-!!"-"$G$9!#(B
> $BLdBj$O-"$N(BAddServiceImpl$B%3%s%9%H%i%/%?$N0z?t$K(B
> opHistoryDao$B$,(Bnull$B$GF~$C$F$-$F$7$^$C$F$$$k$H$3$m$G$9!#(B
> dicon$B%U%!%$%k$K$b(BDao$B!J(BOpHistoryDao $B!K$rDj5A$7$F$$$^$9$7!"(B
> Dao$B$N(BBean$B!"(BSQL$B%U%!%$%kL>>NEy$b5,B'$K=>$C$F$$$^$9!#(B
> $BF1$8$h$&$J8=>]$K$J$C$?J}$,$$$i$C$7$c$$$^$7$?$i!"(B
> $B$<$R$H$b$465<x$/$@$5$$!#(B
> $B!J"($A$J$_$K-!$N(BAddAction$B%/%i%9%3%s%9%H%i%/%?$N0z?t$K$O!"(B
> AddService$B<BAu%/%i%9$N%$%s%9%?%s%9$,$-$A$s$HF~$C$F$-$F$$$^$9!#!K(B
>
> $B-!(BAction$B%/%i%9(Bexecute$B%a%=%C%IDj5A(B--------------------------
>
> //$B%3%s%9%H%i%/%?(B
> public AddAction(AddService addService) {
> this.addService = addService;
> }
>
> public ActionForward execute(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response) {
>
> /** $BMzNr$rEPO?$9$k(B */
> OpHistory opHistory = new OpHistory(); //Bean$B @ 8@.(B
> opHistory.setOpeno("1");
> opHistory.setAction_name("add");
> opHistory.setResult("2");
> opHistory.setTstamp("2005/03/25");
> opHistory.setDelflag(0);
>
> int addCount =
> addService.insert(opHistory);$B!!(B//Bean$B$r3JG<$7!"%F!<%V%k$X(Binsert
>
> return (mapping.findForward("success"));
> }
>
> $B-"(BService$B<BAu%/%i%9%3%s%9%H%i%/%?(B-----------------------------
> public AddServiceImpl(OpHistoryDao opHistoryDao) {
> this.opHistoryDao = opHistoryDao;
> }
>
----------------------------------------------------------------------------
>
> $B3+H/4D6-$O0J2<$NDL$j$G$9!#(B
> $B!&(BJDK$B!'(B1.5
> $B!&(BS2$B!'(B2.2.3
> $B!&(BDao$B!'(B1.0.23
> $B!&(BStruts$B!'(B1.1.4
> $B!&%3%s%F%J!'(BTomcat5.5
> $B!&(BDB$B!'(BHSQL
> $B!&3+H/4D6-!'(BEclipse3.0
>
>
>
>
> ---------------------------------
> Do You Yahoo!?
> Upgrade Your Life> _______________________________________________
> Seasar-user mailing list
> Seasar-user @ lists.sourceforge.jp
> http://lists.sourceforge.jp/mailman/listinfo/seasar-user
Seasar-user メーリングリストの案内