1 <!-- $Id: EntityManager.jsp 405 2011-07-28 21:46:01Z dobashi $ -->
\r
2 <%@page import="java.util.Date"%>
\r
3 <%@ page contentType="text/html; charset=UTF-8" %>
\r
4 <%@ include file="../common/common.jsp" %>
\r
5 <%@ page import="java.text.*" %>
\r
6 <%@page import="com.lavans.lacoder.model.Package"%>
\r
7 <%@ page import="com.lavans.lacoder.model.Entity" %>
\r
11 SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
\r
14 Package pkg = (Package)request.getAttribute("lacoder.package");
\r
15 Entity entity = (Entity)request.getAttribute("lacoder.entity");
\r
16 String className = entity.getClassName();
\r
17 String entityName = entity.getShortname();
\r
20 <title>service</title>
\r
21 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
\r
23 <body text="#000000" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
\r
25 /* $Id: EntityManager.jsp 405 2011-07-28 21:46:01Z dobashi $
\r
26 * 作成日: <%= new SimpleDateFormat("yyyy-MM-dd").format(new Date()) %>
\r
29 package <%= pkg.getServiceSubPackagePath() %>;
\r
31 import org.apache.commons.logging.Log;
\r
32 import org.apache.commons.logging.LogFactory;
\r
33 import java.util.List;
\r
34 import java.util.Map;
\r
35 import java.sql.SQLException;
\r
36 import com.lavans.luz2.util.BeanManager;
\r
37 import com.lavans.luz2.util.PageInfo;
\r
38 import com.lavans.luz2.util.Pager;
\r
40 import <%= pkg.getDomainSubPackagePath() %>.<%= className %>Manager;
\r
41 import <%= pkg.getDomainSubPackagePath() %>.entity.<%= className %>;
\r
44 * Service for <%= entity.getTitle() %>.
\r
48 public class <%= className %>Service {
\r
50 private static Log logger = LogFactory.getLog(<%= className %>Service.class);
\r
52 /** EntityManager */
\r
53 private <%= className %>Manager <%= entityName %>Manager = BeanManager.getBean(<%= className %>Manager.class);
\r
58 private <%= className %>Service(){
\r
59 logger.debug("created.");
\r
75 public <%= className %> read(<%= className %>.PK pk) throws SQLException{
\r
76 if(pk==null) return null;
\r
78 return <%= entityName %>Manager.get<%= className %>(pk);
\r
82 * <%= entity.getTitle() %>登録処理。
\r
84 public <%= className %> create(<%= className %> <%= entityName %>) throws SQLException{
\r
85 return <%= entityName %>Manager.insert(<%= entityName %>);
\r
89 * <%= entity.getTitle() %>更新処理。
\r
91 public <%= className %> update(<%= className %> <%= entityName %>) throws SQLException{
\r
92 return <%= entityName %>Manager.update(<%= entityName %>);
\r
96 * <%= entity.getTitle() %>削除
\r
97 * @param <%= entityName %>
\r
99 * @throws SQLException
\r
101 public int delete(<%= className %>.PK pk) throws SQLException{
\r
102 return <%= entityName %>Manager.delete(pk);
\r
107 * @param searchCondMap
\r
109 * @throws SQLException
\r
111 public List<<%= className %>> list(Map<String,String[]> cond) throws SQLException{
\r
112 return <%= entityName %>Manager.list(cond);
\r
120 * @throws SQLException
\r
122 public Pager<<%= className %>> pager(PageInfo pageInfo, Map<String,String[]> cond) throws SQLException{
\r
123 return <%= entityName %>Manager.pager(pageInfo, cond);
\r