Repository navigation
Expand file tree
/
Copy pathfweb-mapper-java.cst
More file actions
64 lines (52 loc) · 1.99 KB
/
Copy pathfweb-mapper-java.cst
File metadata and controls
64 lines (52 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<%--
Name:
Author: 成七一
Description: Mybatis Mapper Java GENERATE TEMPLATE FOR FWEB(FOREVER WEB RAPID FRAMEWORK)
CreateTime:2014年7月17日 13:34:46
--%>
<%@ Assembly Name="System.Data" %>
<%@ Import Namespace="System.Data" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
<%@ Assembly Name="System" %>
<%@ Import Namespace="System" %>
<%@ Map Name="JavaAlias" Src="mysql-java-alias" %>
<%@ Template Language="C#" TargetLanguage="Java" %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Database" Description="只能选择一个表." %>
<%@ Property Name="NameSpace" Type="System.String" Category="Context" Default="org.hhwy.rdc.fweb1" %>
<%@ Property Name="Author" Type="System.String" Category="Context" Default="cqiyi" %>
/**
* @ <%=Author%> create in <%=System.DateTime.Now%> by Template
* This class generated by Forever Web Rapid Framework Code Generator
*/
package <%=NameSpace%>.mapper;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import <%=NameSpace%>.domain.<%=GetDomainClassName()%>;
import <%=NameSpace%>.mapper.partial.Partial<%=GetDomainClassName()%>Mapper;
/**
* 数据表: [<%=SourceTable.Name%>]
* <%=SourceTable.Description %>
*/
@Repository
public interface <%=GetDomainClassName()%>Mapper extends Partial<%=GetDomainClassName()%>Mapper {
}
<script runat="template">
public override string GetFileName() {
return GetDomainClassName() + "Mapper.java";
}
public string GetDomainClassName() {
return StringUtil.ToPascalCase(SourceTable.Name.TrimStart("t_".ToCharArray()));
}
public string GetDomainVariableName() {
return StringUtil.ToCamelCase(SourceTable.Name.TrimStart("t_".ToCharArray()));
}
public string GetJavaType(ColumnSchema col) {
try{
return JavaAlias[col.NativeType];
}catch(Exception ex){
return col.NativeType + "[N/A]";
}
}
</script>