[Seasar-user:1680] Service 実装クラスから Dao を呼ぶ
yamafuji yama
yamafujiyamajp
2005年 3月 26日 (土) 09:55:13 JST
$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$[E-MAIL ADDRESS DELETED]@.(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
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$,=|5n$5$l$^$7$?(B.
URL: http://lists.sourceforge.jp/mailman/archives/seasar-user/attachments/20050326/d16e0822/attachment-0001.htm
Seasar-user メーリングリストの案内