├── .idea
├── .name
├── AutoGenerator-1.1.0.zip
├── AutoGenerator.iml
├── autoProjectGenerator.xml
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── libraries
│ └── freemarker_2_3_18.xml
├── misc.xml
├── modules.xml
├── uiDesigner.xml
├── vcs.xml
└── workspace.xml
├── AutoGenerator.iml
├── META-INF
└── plugin.xml
├── README.md
├── out
├── cn
│ └── fishy
│ │ └── plugin
│ │ └── idea
│ │ └── auto
│ │ ├── ShowDialog.class
│ │ ├── component
│ │ └── PsiFileManager.class
│ │ ├── constant
│ │ ├── ColumnEnum.class
│ │ ├── GenerateType.class
│ │ ├── ImportMapHolder.class
│ │ └── TypePath.class
│ │ ├── domain
│ │ ├── Code.class
│ │ ├── Column.class
│ │ ├── Encoding.class
│ │ ├── Language.class
│ │ ├── PomNamespaceContext.class
│ │ ├── Setting.class
│ │ ├── SqlInfo.class
│ │ └── TemplateConfig.class
│ │ ├── generator
│ │ ├── BaseGenerator.class
│ │ ├── BoGenerator.class
│ │ ├── CodeAbstractGenerator.class
│ │ ├── DAOXmlGenerator.class
│ │ ├── DaoGenerator.class
│ │ ├── DaoImplGenerator.class
│ │ ├── DoGenerator.class
│ │ ├── GeneratorAdaptor.class
│ │ ├── JavaGenerator.class
│ │ ├── ManagerGenerator.class
│ │ ├── ManagerImplGenerator.class
│ │ ├── PersistenceXmlGenerator.class
│ │ ├── QueryGenerator.class
│ │ ├── SQLMapConfigXmlGenerator.class
│ │ ├── ScalaGenerator.class
│ │ ├── SqlmapGenerator.class
│ │ ├── TransferGenerator.class
│ │ ├── java
│ │ │ ├── JavaBaseDAOGenerator.class
│ │ │ ├── JavaBaseQueryGenerator.class
│ │ │ ├── JavaBoGenerator.class
│ │ │ ├── JavaDAOXmlGenerator.class
│ │ │ ├── JavaDaoGenerator.class
│ │ │ ├── JavaDaoImplGenerator.class
│ │ │ ├── JavaDoGenerator.class
│ │ │ ├── JavaManagerGenerator.class
│ │ │ ├── JavaManagerImplGenerator.class
│ │ │ ├── JavaPersistenceXmlGenerator.class
│ │ │ ├── JavaQueryGenerator.class
│ │ │ ├── JavaSQLMapConfigXmlGenerator.class
│ │ │ ├── JavaSqlmapGenerator.class
│ │ │ └── JavaTransferGenerator.class
│ │ └── scala
│ │ │ ├── ScalaBaseDAOGenerator.class
│ │ │ ├── ScalaBaseQueryGenerator.class
│ │ │ ├── ScalaBoGenerator.class
│ │ │ ├── ScalaDAOXmlGenerator.class
│ │ │ ├── ScalaDaoGenerator.class
│ │ │ ├── ScalaDaoImplGenerator.class
│ │ │ ├── ScalaDoGenerator.class
│ │ │ ├── ScalaManagerGenerator.class
│ │ │ ├── ScalaManagerImplGenerator.class
│ │ │ ├── ScalaPersistenceXmlGenerator.class
│ │ │ ├── ScalaQueryGenerator.class
│ │ │ ├── ScalaSQLMapConfigXmlGenerator.class
│ │ │ ├── ScalaSqlmapGenerator.class
│ │ │ └── ScalaTransferGenerator.class
│ │ ├── storage
│ │ ├── Env.class
│ │ ├── PluginConfigHolder.class
│ │ ├── PluginProjectConfigHolder.class
│ │ ├── SettingManager.class
│ │ └── domain
│ │ │ ├── PluginConfig.class
│ │ │ └── PluginProjectConfig.class
│ │ ├── ui
│ │ ├── GeneratorMainDialog$1.class
│ │ ├── GeneratorMainDialog$10.class
│ │ ├── GeneratorMainDialog$11.class
│ │ ├── GeneratorMainDialog$12.class
│ │ ├── GeneratorMainDialog$13.class
│ │ ├── GeneratorMainDialog$14.class
│ │ ├── GeneratorMainDialog$15.class
│ │ ├── GeneratorMainDialog$2.class
│ │ ├── GeneratorMainDialog$3.class
│ │ ├── GeneratorMainDialog$4.class
│ │ ├── GeneratorMainDialog$5.class
│ │ ├── GeneratorMainDialog$6.class
│ │ ├── GeneratorMainDialog$7.class
│ │ ├── GeneratorMainDialog$8.class
│ │ ├── GeneratorMainDialog$9.class
│ │ ├── GeneratorMainDialog$CheckBoxCellEditor.class
│ │ ├── GeneratorMainDialog$CheckBoxRenderer.class
│ │ └── GeneratorMainDialog.class
│ │ └── util
│ │ ├── CharsetChanger.class
│ │ ├── FileEncoder.class
│ │ ├── FileOpener.class
│ │ ├── FileWriter.class
│ │ ├── Matcher.class
│ │ ├── NameUtil.class
│ │ ├── PathHolder.class
│ │ ├── PomAnalyzer.class
│ │ ├── RegexUtil.class
│ │ ├── ResourceUtil.class
│ │ ├── SqlAnaly.class
│ │ ├── TemplateUtil.class
│ │ └── TypeChanger.class
├── com
│ └── intellij
│ │ └── uiDesigner
│ │ └── core
│ │ ├── AbstractLayout.class
│ │ ├── DimensionInfo.class
│ │ ├── GridConstraints.class
│ │ ├── GridLayoutManager.class
│ │ ├── HorizontalInfo.class
│ │ ├── LayoutState.class
│ │ ├── Spacer.class
│ │ ├── SupportCode$TextWithMnemonic.class
│ │ ├── SupportCode.class
│ │ ├── Util.class
│ │ └── VerticalInfo.class
├── icons
│ ├── auto.png
│ └── auto@2x.png
├── intro
│ └── res.properties
├── templates
│ ├── java
│ │ ├── basedao.vm
│ │ ├── basequery.vm
│ │ ├── dao.vm
│ │ ├── dao.xml.vm
│ │ ├── daoimpl.vm
│ │ ├── do.vm
│ │ ├── manager.vm
│ │ ├── managerimpl.vm
│ │ ├── persistence.xml.vm
│ │ ├── sqlmap-config.xml.vm
│ │ ├── sqlmap.xml.vm
│ │ └── transfer.vm
│ └── scala
│ │ ├── dao.vm
│ │ ├── daoimpl.vm
│ │ ├── do.vm
│ │ ├── manager.vm
│ │ ├── managerimpl.vm
│ │ └── transfer.vm
└── tpl
│ ├── java
│ ├── basedao.ftl
│ ├── basequery.ftl
│ ├── dao.ftl
│ ├── daoimpl.ftl
│ ├── daoxml-line.ftl
│ ├── daoxml.ftl
│ ├── do.ftl
│ ├── manager.ftl
│ ├── managerimpl.ftl
│ ├── persistence.ftl
│ ├── sqlmap.ftl
│ ├── sqlmapconfig.ftl
│ └── transfer.ftl
│ └── scala
│ ├── dao.ftl
│ ├── daoimpl.ftl
│ ├── do.ftl
│ ├── manager.ftl
│ ├── managerimpl.ftl
│ └── transfer.ftl
├── releases
├── AutoGenerator-1.0.0.jar
├── AutoGenerator-1.0.1-jdk1.6.jar
├── AutoGenerator-1.0.2.jar
├── AutoGenerator-1.0.2.rar
├── AutoGenerator-1.0.3.jar
├── AutoGenerator-1.0.4.zip
├── AutoGenerator-1.0.5.zip
├── AutoGenerator-1.0.6.zip
├── AutoGenerator-1.0.7.zip
├── AutoGenerator-1.0.8.zip
└── AutoGenerator-1.1.0.zip
├── resources
├── icons
│ ├── auto.png
│ └── auto@2x.png
├── intro
│ └── res.properties
├── templates
│ ├── java
│ │ ├── basedao.vm
│ │ ├── basequery.vm
│ │ ├── bo.vm
│ │ ├── dao.vm
│ │ ├── dao.xml.vm
│ │ ├── daoimpl.vm
│ │ ├── do.vm
│ │ ├── manager.vm
│ │ ├── managerimpl.vm
│ │ ├── persistence.xml.vm
│ │ ├── query.vm
│ │ ├── sqlmap-config.xml.vm
│ │ ├── sqlmap.vm
│ │ └── transfer.vm
│ └── scala
│ │ ├── basedao.vm
│ │ ├── basequery.vm
│ │ ├── bo.vm
│ │ ├── dao.vm
│ │ ├── dao.xml.vm
│ │ ├── daoimpl.vm
│ │ ├── do.vm
│ │ ├── manager.vm
│ │ ├── managerimpl.vm
│ │ ├── persistence.xml.vm
│ │ ├── query.vm
│ │ ├── sqlmap-config.xml.vm
│ │ ├── sqlmap.vm
│ │ └── transfer.vm
└── tpl
│ ├── java
│ ├── basedao.ftl
│ ├── basequery.ftl
│ ├── dao.ftl
│ ├── daoimpl.ftl
│ ├── daoxml-line.ftl
│ ├── daoxml.ftl
│ ├── do.ftl
│ ├── manager.ftl
│ ├── managerimpl.ftl
│ ├── persistence.ftl
│ ├── sqlmap.ftl
│ ├── sqlmapconfig.ftl
│ └── transfer.ftl
│ └── scala
│ ├── dao.ftl
│ ├── daoimpl.ftl
│ ├── do.ftl
│ ├── manager.ftl
│ ├── managerimpl.ftl
│ └── transfer.ftl
├── src
└── cn
│ └── fishy
│ └── plugin
│ └── idea
│ └── auto
│ ├── ShowDialog.java
│ ├── component
│ └── PsiFileManager.java
│ ├── constant
│ ├── ColumnEnum.java
│ ├── GenerateType.java
│ ├── ImportMapHolder.java
│ └── TypePath.java
│ ├── domain
│ ├── Code.java
│ ├── Column.java
│ ├── Encoding.java
│ ├── Language.java
│ ├── PomNamespaceContext.java
│ ├── Setting.java
│ ├── SqlInfo.java
│ └── TemplateConfig.java
│ ├── generator
│ ├── BaseGenerator.java
│ ├── BoGenerator.java
│ ├── CodeAbstractGenerator.java
│ ├── DAOXmlGenerator.java
│ ├── DaoGenerator.java
│ ├── DaoImplGenerator.java
│ ├── DoGenerator.java
│ ├── GeneratorAdaptor.java
│ ├── JavaGenerator.java
│ ├── ManagerGenerator.java
│ ├── ManagerImplGenerator.java
│ ├── PersistenceXmlGenerator.java
│ ├── QueryGenerator.java
│ ├── SQLMapConfigXmlGenerator.java
│ ├── ScalaGenerator.java
│ ├── SqlmapGenerator.java
│ ├── TransferGenerator.java
│ ├── java
│ │ ├── JavaBaseDAOGenerator.java
│ │ ├── JavaBaseQueryGenerator.java
│ │ ├── JavaBoGenerator.java
│ │ ├── JavaDAOXmlGenerator.java
│ │ ├── JavaDaoGenerator.java
│ │ ├── JavaDaoImplGenerator.java
│ │ ├── JavaDoGenerator.java
│ │ ├── JavaManagerGenerator.java
│ │ ├── JavaManagerImplGenerator.java
│ │ ├── JavaPersistenceXmlGenerator.java
│ │ ├── JavaQueryGenerator.java
│ │ ├── JavaSQLMapConfigXmlGenerator.java
│ │ ├── JavaSqlmapGenerator.java
│ │ └── JavaTransferGenerator.java
│ └── scala
│ │ ├── ScalaBaseDAOGenerator.java
│ │ ├── ScalaBaseQueryGenerator.java
│ │ ├── ScalaBoGenerator.java
│ │ ├── ScalaDAOXmlGenerator.java
│ │ ├── ScalaDaoGenerator.java
│ │ ├── ScalaDaoImplGenerator.java
│ │ ├── ScalaDoGenerator.java
│ │ ├── ScalaManagerGenerator.java
│ │ ├── ScalaManagerImplGenerator.java
│ │ ├── ScalaPersistenceXmlGenerator.java
│ │ ├── ScalaQueryGenerator.java
│ │ ├── ScalaSQLMapConfigXmlGenerator.java
│ │ ├── ScalaSqlmapGenerator.java
│ │ └── ScalaTransferGenerator.java
│ ├── storage
│ ├── Env.java
│ ├── PluginConfigHolder.java
│ ├── PluginProjectConfigHolder.java
│ ├── SettingManager.java
│ └── domain
│ │ ├── PluginConfig.java
│ │ └── PluginProjectConfig.java
│ ├── ui
│ ├── GeneratorMainDialog.form
│ └── GeneratorMainDialog.java
│ └── util
│ ├── CharsetChanger.java
│ ├── FileEncoder.java
│ ├── FileOpener.java
│ ├── FileWriter.java
│ ├── Matcher.java
│ ├── NameUtil.java
│ ├── PathHolder.java
│ ├── PomAnalyzer.java
│ ├── RegexUtil.java
│ ├── ResourceUtil.java
│ ├── SqlAnaly.java
│ ├── TemplateUtil.java
│ └── TypeChanger.java
├── sreenshot
├── Image 1-2.png
├── Image 1-2.psd
├── Image 1.png
├── Image 1.psd
├── Image 12.png
├── Image 13.png
├── Image 13.psd
├── Image 16.png
├── Image 16.psd
├── Image 17.png
├── Image 2.png
├── Image 21.png
├── Image 23.png
├── Image 3.png
├── Image 4.png
├── Image 5.png
└── Image-16.png
└── velocity.log
/.idea/.name:
--------------------------------------------------------------------------------
1 | AutoGenerator
--------------------------------------------------------------------------------
/.idea/AutoGenerator-1.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/.idea/AutoGenerator-1.1.0.zip
--------------------------------------------------------------------------------
/.idea/AutoGenerator.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/autoProjectGenerator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/libraries/freemarker_2_3_18.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AutoGenerator.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AutoGenerator
2 |
3 | ### 插件最新更新
4 |
5 | 1.1.0 - 2016.5.6 升级了模板引擎(从freemarker到velocity), 支持用户自定义.
6 |
7 |
8 | 最新版本下载: [AutoGenerator-1.1.0.zip](https://github.com/i17c/AutoGenerator/raw/master/releases/AutoGenerator-1.1.0.zip)
9 |
10 | 自定义模板方式-> Settings -> 勾选 "Use Custom TPL"后设置 "Custom TPL Path", 然后初始化"Templates Init"
11 |
12 |
13 | ### 插件说明
14 |
15 | It's a tool for auto generate Data Persistence Layer by Create Table SQL.
16 |
17 | What is "Data Persistence Layer", just contain DO, Query, DAO, Manager, And sqlmap ...
18 |
19 | I designed it just for java and scala . other languages maybe later ...
20 |
21 | The generate code will use ibatis and tddl to access database.
22 |
23 | If you don't like, change it your self. of course, you also can send other framework to me .
24 |
25 | This tool will appeared at "Tools" menu and "Go To" menu, shortcut key is: ctrl+shift+\
26 |
27 | 本工具根据建表语句自动创建数据持久层.
28 |
29 | 数据持久层包含DO, Query, DAO, Manager, sqlmap 等
30 |
31 | 本工具只设计为生成java和scala代码, 也许以后也会有更多的代码支持
32 |
33 | 生成的代码默认使用了ibatis和 tddl, 如果你不喜欢, 请自行生成后替换.
34 |
35 | 当然, 也可以反馈给我, 其他更好的建议.
36 |
37 | 本工具将在"Tools"菜单中和"Go To"菜单中会出现, 快捷键: ctrl+shift+\
38 |
39 | ### 插件功能
40 |
41 | 插件实现的功能是可以生成 DO, DAO, DAOImpl, Query, Manager, ManagerImpl, BO, Transfer, sqlMap等等...
42 |
43 | 而你需要做的就是快捷键ctrl+alt+\ (mac可能为mac+alt+\) 唤起插件后 填入sql -> analy -> 选择正确的输出目录 -> 生成
44 |
45 | 
46 | 
47 |
48 | 其中, 在输出目录选择的时候, 请选择要生成代码的biz目录. 生成的路径对应关系如下
49 | 
50 |
51 | | 文件 | 生成目录 |
52 | | ---- | ---- |
53 | | DO | ${outpath}/dal/dataobject/ |
54 | | Query | ${outpath}/dal/query/ |
55 | | DAO | ${outpath}/dal/dao/ |
56 | | DAOImpl | ${outpath}/dal/dao/impl/ |
57 | | Manager| ${outpath}/manager/ |
58 | | Manager| ${outpath}/manager/impl/ |
59 | | BO| ${outpath}/bo/ |
60 | | Transfer | ${outpath}/transfer/ |
61 | | BaseDAO| ${outpath}/dal/dao/ |
62 | | BaseQuery| ${outpath}/dal/query/ |
63 | | sqlmap | ${resource_path}/dal/sqlmap/ |
64 | | dao-xml-sample | ${resource_path}/dal/ |
65 | | sqlmap-config-xml-sample | ${resource_path}/dal/ |
66 | | persistence-sample | ${resource_path}/dal/ |
67 |
68 | 其中resource_path为自动分析outpath分析得到, 如果生成的不对, 还请见谅.
69 |
70 | 其中对于do bo query对象的生成上 相应的复选框可以选择要关注的字段
71 |
72 | 
73 | 
74 |
75 | 在这个之前, 你可以在setting标签页设置输出代码的author
76 | 
77 |
78 | 插件安装方式可以下载后以本地方式安装 ( settings -> plugins -> Browse repositories... ), 或者去idea的插件库下载 ( settings -> plugins -> Browse repositories...)
79 |
80 | 插件安装后, 你可以在两个地方找到插件
81 |
82 | 1. Tools菜单栏
83 |
84 | 2. 右键Go To 菜单
85 |
86 | 具体screenshot可以查看源码中的相应目录.
87 |
88 | 插件有任何问题请提bug给我. 麻烦啦 [https://github.com/i17c/AutoGenerator/issues](https://github.com/i17c/AutoGenerator/issues)
89 |
90 |
91 | 相关链接: [Webx开发IDEA插件 - Webx Link (Webx框架下开发java和vm模板快速切换)](https://github.com/i17c/WebxLink)
92 |
93 |
94 | php lite-sample version : [auto](https://github.com/i17c/auto)
95 |
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ShowDialog.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ShowDialog.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/component/PsiFileManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/component/PsiFileManager.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/constant/ColumnEnum.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/constant/ColumnEnum.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/constant/GenerateType.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/constant/GenerateType.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/constant/ImportMapHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/constant/ImportMapHolder.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/constant/TypePath.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/constant/TypePath.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/Code.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/Code.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/Column.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/Column.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/Encoding.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/Encoding.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/Language.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/Language.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/PomNamespaceContext.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/PomNamespaceContext.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/Setting.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/Setting.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/SqlInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/SqlInfo.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/domain/TemplateConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/domain/TemplateConfig.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/BaseGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/BaseGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/BoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/BoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/CodeAbstractGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/CodeAbstractGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/DAOXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/DAOXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/DaoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/DaoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/DaoImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/DaoImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/DoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/DoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/GeneratorAdaptor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/GeneratorAdaptor.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/JavaGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/JavaGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/ManagerGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/ManagerGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/ManagerImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/ManagerImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/PersistenceXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/PersistenceXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/QueryGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/QueryGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/SQLMapConfigXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/SQLMapConfigXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/ScalaGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/ScalaGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/SqlmapGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/SqlmapGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/TransferGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/TransferGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaBaseDAOGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaBaseDAOGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaBaseQueryGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaBaseQueryGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaBoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaBoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaDAOXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaDAOXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaDaoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaDaoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaDaoImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaDaoImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaDoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaDoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaManagerGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaManagerGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaManagerImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaManagerImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaPersistenceXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaPersistenceXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaQueryGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaQueryGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaSQLMapConfigXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaSQLMapConfigXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaSqlmapGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaSqlmapGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/java/JavaTransferGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/java/JavaTransferGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseDAOGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseDAOGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseQueryGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseQueryGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaBoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDAOXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDAOXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDoGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaDoGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerImplGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerImplGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaPersistenceXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaPersistenceXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaQueryGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaQueryGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaSQLMapConfigXmlGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaSQLMapConfigXmlGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaSqlmapGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaSqlmapGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaTransferGenerator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/generator/scala/ScalaTransferGenerator.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/Env.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/Env.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/PluginConfigHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/PluginConfigHolder.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/PluginProjectConfigHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/PluginProjectConfigHolder.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/SettingManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/SettingManager.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/domain/PluginConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/domain/PluginConfig.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/storage/domain/PluginProjectConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/storage/domain/PluginProjectConfig.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$1.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$10.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$10.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$11.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$11.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$12.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$12.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$13.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$13.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$14.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$14.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$15.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$15.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$2.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$3.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$4.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$4.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$5.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$5.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$6.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$6.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$7.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$7.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$8.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$8.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$9.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$9.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$CheckBoxCellEditor.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$CheckBoxCellEditor.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$CheckBoxRenderer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog$CheckBoxRenderer.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/ui/GeneratorMainDialog.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/CharsetChanger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/CharsetChanger.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/FileEncoder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/FileEncoder.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/FileOpener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/FileOpener.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/FileWriter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/FileWriter.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/Matcher.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/Matcher.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/NameUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/NameUtil.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/PathHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/PathHolder.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/PomAnalyzer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/PomAnalyzer.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/RegexUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/RegexUtil.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/ResourceUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/ResourceUtil.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/SqlAnaly.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/SqlAnaly.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/TemplateUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/TemplateUtil.class
--------------------------------------------------------------------------------
/out/cn/fishy/plugin/idea/auto/util/TypeChanger.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/cn/fishy/plugin/idea/auto/util/TypeChanger.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/AbstractLayout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/AbstractLayout.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/DimensionInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/DimensionInfo.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/GridConstraints.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/GridConstraints.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/GridLayoutManager.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/GridLayoutManager.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/HorizontalInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/HorizontalInfo.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/LayoutState.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/LayoutState.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/Spacer.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/Spacer.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/SupportCode$TextWithMnemonic.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/SupportCode$TextWithMnemonic.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/SupportCode.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/SupportCode.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/Util.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/Util.class
--------------------------------------------------------------------------------
/out/com/intellij/uiDesigner/core/VerticalInfo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/com/intellij/uiDesigner/core/VerticalInfo.class
--------------------------------------------------------------------------------
/out/icons/auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/icons/auto.png
--------------------------------------------------------------------------------
/out/icons/auto@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/out/icons/auto@2x.png
--------------------------------------------------------------------------------
/out/intro/res.properties:
--------------------------------------------------------------------------------
1 | intro =
Auto Generator It's a tool for auto generate Data Persistence Layer by Create Table SQL. What is "Data Persistence Layer", just contain DO, Query, DAO, Manager, And sqlmap ... I designed it just for java and scala . other languages maybe later ... The generate code will use ibatis and tddl to access database. If you don't like, change it your self. of course, you also can send other framework to me . \u672C\u5DE5\u5177\u6839\u636E\u5EFA\u8868\u8BED\u53E5\u81EA\u52A8\u521B\u5EFA\u6570\u636E\u6301\u4E45\u5C42. \u6570\u636E\u6301\u4E45\u5C42\u5305\u542BDO, Query, DAO, Manager, sqlmap \u7B49 \u672C\u5DE5\u5177\u53EA\u8BBE\u8BA1\u4E3A\u751F\u6210java\u548Cscala\u4EE3\u7801, \u4E5F\u8BB8\u4EE5\u540E\u4E5F\u4F1A\u6709\u66F4\u591A\u7684\u4EE3\u7801\u652F\u6301 \u672C\u5DE5\u5177\u751F\u6210\u7684\u4EE3\u7801\u9ED8\u8BA4\u4F7F\u7528\u4E86ibastic\u548Ctddl , \u5982\u679C\u4F60\u4E0D\u559C\u6B22, \u8BF7\u81EA\u884C\u751F\u6210\u540E\u66FF\u6362. \u5F53\u7136, \u4E5F\u53EF\u4EE5\u53CD\u9988\u7ED9\u6211, \u5176\u4ED6\u66F4\u597D\u7684\u5EFA\u8BAE.
2 |
--------------------------------------------------------------------------------
/out/templates/java/basequery.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * BaseQuery
7 | * Date: ${today}
8 | * Generate by autoBaseQuery
9 | * Powered by duxing@Taobao
10 | */
11 |
12 | public class BaseQuery implements Serializable {
13 | private static final long serialVersionUID = 6695437844594466710L;
14 |
15 | private static final Integer DEFAULT_LIMIT = 20;
16 | private static final Integer DEFAULT_CURRENT_PAGE = 1;
17 |
18 | private Integer limit;
19 | private Integer currentPage;
20 |
21 |
22 | public void setCurrentPage(Integer currentPage) {
23 | if(currentPage>0){
24 | this.currentPage = currentPage;
25 | }
26 | }
27 |
28 | public void setLimit(Integer limit) {
29 | if(limit>0){
30 | this.limit = limit;
31 | }
32 | }
33 |
34 | public Integer getStartRow() {
35 | return (getCurrentPage()-1)*getLimit();
36 | }
37 |
38 | public Integer getLimit() {
39 | if(this.limit==null)limit=DEFAULT_LIMIT;
40 | return limit;
41 | }
42 |
43 | public Integer getCurrentPage() {
44 | if(this.currentPage==null)currentPage=DEFAULT_CURRENT_PAGE;
45 | return currentPage;
46 | }
47 | }
--------------------------------------------------------------------------------
/out/templates/java/dao.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | public interface ${className}{
19 |
20 |
21 | /**
22 | * insert one data
23 | *
24 | * @param ${objPropertyName} object
25 | * @return primaryKey ${primaryKeyType}
26 | * @throws Exception exception
27 | */
28 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
29 |
30 | /**
31 | * update data
32 | *
33 | * @param ${objPropertyName} object
34 | * @return update num
35 | * @throws Exception exception
36 | */
37 | public int update(${objClassName} ${objPropertyName}) throws Exception;
38 |
39 | /**
40 | * get an obj
41 | *
42 | * @param ${primaryKeyName} key
43 | * @return obj obj
44 | * @throws Exception exception
45 | */
46 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
47 |
48 | /**
49 | * query a list
50 | *
51 | * @param ${queryPropertyName} query
52 | * @return List
53 | * @throws Exception exception
54 | */
55 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
56 |
57 | /**
58 | * query count
59 | *
60 | * @param ${queryPropertyName} query
61 | * @return Integer
62 | * @throws Exception exception
63 | */
64 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
65 |
66 | /**
67 | #if(${daoLogicDelete})
68 | * logically delete one line
69 | #else
70 | * physically delete one line
71 | #end
72 | *
73 | * @param ${primaryKeyName} key
74 | * @return delete num
75 | * @throws Exception exception
76 | */
77 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
78 |
79 | }
--------------------------------------------------------------------------------
/out/templates/java/dao.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/out/templates/java/do.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public class ${className}#if($pagerQuery) extends BaseQuery#else implements Serializable#end{
18 | private static final long serialVersionUID = -1L;
19 |
20 | #foreach($!{column} in $!{columnList})
21 | /**
22 | * ${column.comment}
23 | */
24 | private ${column.type} ${column.property};
25 | #end
26 |
27 | #foreach($!{column} in $!{columnList})
28 | /**
29 | * ${column.property} getter & setter
30 | */
31 | public ${column.type} get${column.key}() {
32 | return ${column.property};
33 | }
34 | public void set${column.key}(${column.type} ${column.property}){
35 | this.${column.property} = ${column.property};
36 | }
37 |
38 | #end
39 | }
--------------------------------------------------------------------------------
/out/templates/java/manager.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public interface ${className}{
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
27 |
28 | /**
29 | * update data
30 | *
31 | * @param ${objPropertyName} object
32 | * @return update num
33 | * @throws Exception exception
34 | */
35 | public int update(${objClassName} ${objPropertyName}) throws Exception;
36 |
37 | /**
38 | * get an obj
39 | *
40 | * @param ${primaryKeyName} key
41 | * @return obj obj
42 | * @throws Exception exception
43 | */
44 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
45 |
46 | /**
47 | * query a list
48 | *
49 | * @param ${queryPropertyName} query
50 | * @return List
51 | * @throws Exception exception
52 | */
53 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
54 |
55 | /**
56 | * query count
57 | *
58 | * @param ${queryPropertyName} query
59 | * @return Integer
60 | * @throws Exception exception
61 | */
62 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
63 |
64 | /**
65 | * logic delete one line
66 | *
67 | * @param ${primaryKeyName} key
68 | * @return delete num
69 | * @throws Exception exception
70 | */
71 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
72 |
73 | }
--------------------------------------------------------------------------------
/out/templates/java/persistence.xml.vm:
--------------------------------------------------------------------------------
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 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/out/templates/java/sqlmap-config.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/out/templates/java/transfer.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 |
9 | /**
10 | * ${transferClassName}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | public class ${transferClassName}{
19 |
20 | public static ${boClassName} toBO(${doClassName} d) {
21 | if (d == null) return null;
22 | ${boClassName} bo = new ${boClassName}();
23 | #foreach($!{column} in $!{columnList})
24 | bo.set${column.key}(d.get${column.key}());
25 | #end
26 | return bo;
27 | }
28 |
29 | public static ${doClassName} toDO(${boClassName} bo) {
30 | if (bo == null) return null;
31 | ${doClassName} d = new ${doClassName}();
32 | #foreach($!{column} in $!{columnList})
33 | d.set${column.key}(bo.get${column.key}());
34 | #end
35 | return d;
36 | }
37 |
38 | public static List<${boClassName}> toBOList(List<${doClassName}> doList){
39 | if(doList == null) {
40 | return new ArrayList<${boClassName}>();
41 | }
42 | List<${boClassName}> boList = new ArrayList<${boClassName}>();
43 | for(${doClassName} d : doList) {
44 | if(d != null) {
45 | boList.add(${transferClassName}.toBO(d));
46 | }
47 | }
48 | return boList;
49 | }
50 |
51 | public static List<${doClassName}> toDOList(List<${boClassName}> boList){
52 | if(boList == null) {
53 | return new ArrayList<${doClassName}>();
54 | }
55 | List<${doClassName}> doList = new ArrayList<${doClassName}>();
56 | for(${boClassName} bo : boList) {
57 | if(bo != null) {
58 | doList.add(${transferClassName}.toDO(bo));
59 | }
60 | }
61 | return doList;
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/out/templates/scala/dao.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | trait ${className} extends BaseDAO{
19 |
20 |
21 | /**
22 | * insert one data
23 | *
24 | * @param ${objPropertyName} object
25 | * @return primaryKey ${primaryKeyType}
26 | * @throws Exception exception
27 | */
28 | @throws(classOf[Exception])
29 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
30 |
31 | /**
32 | * update data
33 | *
34 | * @param ${objPropertyName} object
35 | * @return update num
36 | * @throws Exception exception
37 | */
38 | @throws(classOf[Exception])
39 | def update(${objPropertyName}: ${objClassName}): Int
40 |
41 | /**
42 | * get an obj
43 | *
44 | * @param ${primaryKeyName} key
45 | * @return obj obj
46 | * @throws Exception exception
47 | */
48 | @throws(classOf[Exception])
49 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
50 |
51 | /**
52 | * query a list
53 | *
54 | * @param ${queryPropertyName} query
55 | * @return List
56 | * @throws Exception exception
57 | */
58 | @throws(classOf[Exception])
59 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
60 |
61 | /**
62 | * query count
63 | *
64 | * @param ${queryPropertyName} query
65 | * @return Integer
66 | * @throws Exception exception
67 | */
68 | @throws(classOf[Exception])
69 | def getCount(${queryPropertyName}: ${queryClassName}): Int
70 |
71 | /**
72 | #if($daoLogicDelete)
73 | * logically delete one line
74 | #else
75 | * physically delete one line
76 | #end
77 | *
78 | * @param ${primaryKeyName} key
79 | * @return delete num
80 | * @throws Exception exception
81 | */
82 | @throws(classOf[Exception])
83 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
84 |
85 | }
--------------------------------------------------------------------------------
/out/templates/scala/do.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | #foreach($import in $!{importList})
6 | #if("$!{import}"!="")
7 | import $!{import}
8 | #end
9 | #end
10 |
11 | /**
12 | * ${className}
13 | *
14 | * User: ${user}
15 | * Date: ${today}
16 | * Generate by ${autoName}
17 | * Powered by duxing@Taobao
18 | */
19 | @SerialVersionUID(-1L)
20 | class ${className}#if($pagerQuery) extends BaseQuery#else extends Serializable#end{
21 |
22 | #foreach($!{column} in $!{columnList})
23 | /**
24 | * ${column.comment}
25 | */
26 | @BeanProperty var ${column.property}: ${column.type} = _
27 | #end
28 |
29 | }
--------------------------------------------------------------------------------
/out/templates/scala/manager.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | trait ${className}{
19 |
20 | /**
21 | * insert one data
22 | *
23 | * @param ${objPropertyName} object
24 | * @return primaryKey ${primaryKeyType}
25 | * @throws Exception exception
26 | */
27 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
28 |
29 | /**
30 | * update data
31 | *
32 | * @param ${objPropertyName} object
33 | * @return update num
34 | * @throws Exception exception
35 | */
36 | def update(${objPropertyName}: ${objClassName}): Int
37 |
38 | /**
39 | * get an obj
40 | *
41 | * @param ${primaryKeyName} key
42 | * @return obj obj
43 | * @throws Exception exception
44 | */
45 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
46 |
47 | /**
48 | * query a list
49 | *
50 | * @param ${queryPropertyName} query
51 | * @return List
52 | * @throws Exception exception
53 | */
54 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
55 |
56 | /**
57 | * query count
58 | *
59 | * @param ${queryPropertyName} query
60 | * @return Integer
61 | * @throws Exception exception
62 | */
63 | def getCount(${queryPropertyName}: ${queryClassName}): Int
64 |
65 | /**
66 | * logic delete one line
67 | *
68 | * @param ${primaryKeyName} key
69 | * @return delete num
70 | * @throws Exception exception
71 | */
72 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
73 |
74 | }
--------------------------------------------------------------------------------
/out/templates/scala/transfer.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 | import scala.collection.JavaConversions._
9 |
10 | /**
11 | * ${transferClassName}
12 | *
13 | * User: ${user}
14 | * Date: ${today}
15 | * Generate by ${autoName}
16 | * Powered by duxing@Taobao
17 | */
18 |
19 | object ${transferClassName}{
20 | /**
21 | * change do to bo
22 | */
23 | def toBO(d: ${doClassName}): ${boClassName} = {
24 | if (d == null) return null
25 | val bo: ${boClassName} = new ${boClassName}()
26 | #foreach($!{column} in $!{columnList})
27 | bo.set${column.key}(d.get${column.key}())
28 | #end
29 | bo
30 | }
31 |
32 | /**
33 | * change bo to do
34 | */
35 | def toDO(bo: ${boClassName}): ${doClassName} = {
36 | if (bo == null) return null
37 | val d: ${doClassName} = new ${doClassName}()
38 | #foreach($!{column} in $!{columnList})
39 | d.set${column.key}(bo.get${column.key}())
40 | #end
41 | d
42 | }
43 | /**
44 | * change doList to boList
45 | */
46 | def toBOList(doList: util.List[${doClassName}]): util.List[${boClassName}] = {
47 | if(doList == null) {
48 | return new util.ArrayList[${boClassName}]()
49 | }
50 | val boList: util.List[${boClassName}] = new util.ArrayList[${boClassName}]()
51 | doList.foreach(d => {
52 | if(d != null) {
53 | boList.add(${transferClassName}.toBO(d))
54 | }
55 | })
56 | boList
57 | }
58 | /**
59 | * change boList to doList
60 | */
61 | def toDOList(boList: util.List[${boClassName}]): util.List[${doClassName}] = {
62 | if(boList == null) {
63 | return new util.ArrayList[${doClassName}]()
64 | }
65 | val doList: util.List[${doClassName}] = new util.ArrayList[${doClassName}]()
66 | boList.foreach(bo => {
67 | if(bo != null) {
68 | doList.add(${transferClassName}.toDO(bo))
69 | }
70 | })
71 | doList
72 | }
73 |
74 | }
--------------------------------------------------------------------------------
/out/tpl/java/basequery.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * BaseQuery
7 | * Date: ${today}
8 | * Generate by autoBaseQuery
9 | * Powered by duxing@Taobao
10 | */
11 |
12 | public class BaseQuery implements Serializable {
13 | private static final long serialVersionUID = 6695437844594466710L;
14 |
15 | private static final Integer DEFAULT_LIMIT = 20;
16 | private static final Integer DEFAULT_CURRENT_PAGE = 1;
17 |
18 | private Integer limit;
19 | private Integer currentPage;
20 |
21 |
22 | public void setCurrentPage(Integer currentPage) {
23 | if(currentPage>0){
24 | this.currentPage = currentPage;
25 | }
26 | }
27 |
28 | public void setLimit(Integer limit) {
29 | if(limit>0){
30 | this.limit = limit;
31 | }
32 | }
33 |
34 | public Integer getStartRow() {
35 | return (getCurrentPage()-1)*getLimit();
36 | }
37 |
38 | public Integer getLimit() {
39 | if(this.limit==null)limit=DEFAULT_LIMIT;
40 | return limit;
41 | }
42 |
43 | public Integer getCurrentPage() {
44 | if(this.currentPage==null)currentPage=DEFAULT_CURRENT_PAGE;
45 | return currentPage;
46 | }
47 | }
--------------------------------------------------------------------------------
/out/tpl/java/dao.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public interface ${className}{
17 |
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
27 |
28 | /**
29 | * update data
30 | *
31 | * @param ${objPropertyName} object
32 | * @return update num
33 | * @throws Exception exception
34 | */
35 | public int update(${objClassName} ${objPropertyName}) throws Exception;
36 |
37 | /**
38 | * get an obj
39 | *
40 | * @param ${primaryKeyName} key
41 | * @return obj obj
42 | * @throws Exception exception
43 | */
44 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
45 |
46 | /**
47 | * query a list
48 | *
49 | * @param ${queryPropertyName} query
50 | * @return List
51 | * @throws Exception exception
52 | */
53 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
54 |
55 | /**
56 | * query count
57 | *
58 | * @param ${queryPropertyName} query
59 | * @return Integer
60 | * @throws Exception exception
61 | */
62 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
63 |
64 | /**
65 | <#if daoLogicDelete>
66 | * logically delete one line
67 | <#else>
68 | * physically delete one line
69 | #if>
70 | *
71 | * @param ${primaryKeyName} key
72 | * @return delete num
73 | * @throws Exception exception
74 | */
75 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
76 |
77 | }
--------------------------------------------------------------------------------
/out/tpl/java/daoxml-line.ftl:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/out/tpl/java/daoxml.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <#include "/tpl/java/daoxml-line.ftl">
7 |
8 |
9 |
--------------------------------------------------------------------------------
/out/tpl/java/do.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public class ${className} <#if pagerQuery>extends BaseQuery<#else>implements Serializable#if>{
17 | private static final long serialVersionUID = -1L;
18 |
19 | <#list columnList as column>
20 | /**
21 | * ${column.comment}
22 | */
23 | private ${column.type} ${column.property};
24 | #list>
25 |
26 | <#list columnList as column>
27 | /**
28 | * ${column.property} getter & setter
29 | */
30 | public ${column.type} get${column.key}() {
31 | return ${column.property};
32 | }
33 | public void set${column.key}(${column.type} ${column.property}){
34 | this.${column.property} = ${column.property};
35 | }
36 |
37 | #list>
38 | }
--------------------------------------------------------------------------------
/out/tpl/java/manager.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public interface ${className}{
17 |
18 | /**
19 | * insert one data
20 | *
21 | * @param ${objPropertyName} object
22 | * @return primaryKey ${primaryKeyType}
23 | * @throws Exception exception
24 | */
25 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
26 |
27 | /**
28 | * update data
29 | *
30 | * @param ${objPropertyName} object
31 | * @return update num
32 | * @throws Exception exception
33 | */
34 | public int update(${objClassName} ${objPropertyName}) throws Exception;
35 |
36 | /**
37 | * get an obj
38 | *
39 | * @param ${primaryKeyName} key
40 | * @return obj obj
41 | * @throws Exception exception
42 | */
43 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
44 |
45 | /**
46 | * query a list
47 | *
48 | * @param ${queryPropertyName} query
49 | * @return List
50 | * @throws Exception exception
51 | */
52 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
53 |
54 | /**
55 | * query count
56 | *
57 | * @param ${queryPropertyName} query
58 | * @return Integer
59 | * @throws Exception exception
60 | */
61 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
62 |
63 | /**
64 | * logic delete one line
65 | *
66 | * @param ${primaryKeyName} key
67 | * @return delete num
68 | * @throws Exception exception
69 | */
70 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
71 |
72 | }
--------------------------------------------------------------------------------
/out/tpl/java/persistence.ftl:
--------------------------------------------------------------------------------
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 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/out/tpl/java/sqlmapconfig.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/out/tpl/java/transfer.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${transferClassName}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public class ${transferClassName}{
17 |
18 | public static ${boClassName} toBO(${doClassName} d) {
19 | if (d == null) return null;
20 | ${boClassName} bo = new ${boClassName}();
21 | <#list columnList as column>
22 | bo.set${column.key}(d.get${column.key}());
23 | #list>
24 | return bo;
25 | }
26 |
27 | public static ${doClassName} toDO(${boClassName} bo) {
28 | if (bo == null) return null;
29 | ${doClassName} d = new ${doClassName}();
30 | <#list columnList as column>
31 | d.set${column.key}(bo.get${column.key}());
32 | #list>
33 | return d;
34 | }
35 |
36 | public static List<${boClassName}> toBOList(List<${doClassName}> doList){
37 | if(doList == null) {
38 | return new ArrayList<${boClassName}>();
39 | }
40 | List<${boClassName}> boList = new ArrayList<${boClassName}>();
41 | for(${doClassName} d : doList) {
42 | if(d != null) {
43 | boList.add(${transferClassName}.toBO(d));
44 | }
45 | }
46 | return boList;
47 | }
48 |
49 | public static List<${doClassName}> toDOList(List<${boClassName}> boList){
50 | if(boList == null) {
51 | return new ArrayList<${doClassName}>();
52 | }
53 | List<${doClassName}> doList = new ArrayList<${doClassName}>();
54 | for(${boClassName} bo : boList) {
55 | if(bo != null) {
56 | doList.add(${transferClassName}.toDO(bo));
57 | }
58 | }
59 | return doList;
60 | }
61 |
62 | }
--------------------------------------------------------------------------------
/out/tpl/scala/dao.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | trait ${className} extends BaseDAO{
17 |
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | @throws(classOf[Exception])
27 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
28 |
29 | /**
30 | * update data
31 | *
32 | * @param ${objPropertyName} object
33 | * @return update num
34 | * @throws Exception exception
35 | */
36 | @throws(classOf[Exception])
37 | def update(${objPropertyName}: ${objClassName}): Int
38 |
39 | /**
40 | * get an obj
41 | *
42 | * @param ${primaryKeyName} key
43 | * @return obj obj
44 | * @throws Exception exception
45 | */
46 | @throws(classOf[Exception])
47 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
48 |
49 | /**
50 | * query a list
51 | *
52 | * @param ${queryPropertyName} query
53 | * @return List
54 | * @throws Exception exception
55 | */
56 | @throws(classOf[Exception])
57 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
58 |
59 | /**
60 | * query count
61 | *
62 | * @param ${queryPropertyName} query
63 | * @return Integer
64 | * @throws Exception exception
65 | */
66 | @throws(classOf[Exception])
67 | def getCount(${queryPropertyName}: ${queryClassName}): Int
68 |
69 | /**
70 | <#if daoLogicDelete>
71 | * logically delete one line
72 | <#else>
73 | * physically delete one line
74 | #if>
75 | *
76 | * @param ${primaryKeyName} key
77 | * @return delete num
78 | * @throws Exception exception
79 | */
80 | @throws(classOf[Exception])
81 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
82 |
83 | }
--------------------------------------------------------------------------------
/out/tpl/scala/do.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | <#list importList as import>
6 | import ${import}
7 | #list>
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 | @SerialVersionUID(-1L)
18 | class ${className} <#if pagerQuery>extends BaseQuery<#else>extends Serializable#if>{
19 |
20 | <#list columnList as column>
21 | /**
22 | * ${column.comment}
23 | */
24 | @BeanProperty var ${column.property}: ${column.type} = _
25 | #list>
26 |
27 | }
--------------------------------------------------------------------------------
/out/tpl/scala/manager.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | trait ${className}{
17 |
18 | /**
19 | * insert one data
20 | *
21 | * @param ${objPropertyName} object
22 | * @return primaryKey ${primaryKeyType}
23 | * @throws Exception exception
24 | */
25 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
26 |
27 | /**
28 | * update data
29 | *
30 | * @param ${objPropertyName} object
31 | * @return update num
32 | * @throws Exception exception
33 | */
34 | def update(${objPropertyName}: ${objClassName}): Int
35 |
36 | /**
37 | * get an obj
38 | *
39 | * @param ${primaryKeyName} key
40 | * @return obj obj
41 | * @throws Exception exception
42 | */
43 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
44 |
45 | /**
46 | * query a list
47 | *
48 | * @param ${queryPropertyName} query
49 | * @return List
50 | * @throws Exception exception
51 | */
52 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
53 |
54 | /**
55 | * query count
56 | *
57 | * @param ${queryPropertyName} query
58 | * @return Integer
59 | * @throws Exception exception
60 | */
61 | def getCount(${queryPropertyName}: ${queryClassName}): Int
62 |
63 | /**
64 | * logic delete one line
65 | *
66 | * @param ${primaryKeyName} key
67 | * @return delete num
68 | * @throws Exception exception
69 | */
70 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
71 |
72 | }
--------------------------------------------------------------------------------
/out/tpl/scala/transfer.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 | import scala.collection.JavaConversions._
7 |
8 | /**
9 | * ${transferClassName}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | object ${transferClassName}{
18 | /**
19 | * change do to bo
20 | */
21 | def toBO(d: ${doClassName}): ${boClassName} = {
22 | if (d == null) return null
23 | val bo: ${boClassName} = new ${boClassName}()
24 | <#list columnList as column>
25 | bo.set${column.key}(d.get${column.key}())
26 | #list>
27 | bo
28 | }
29 |
30 | /**
31 | * change bo to do
32 | */
33 | def toDO(bo: ${boClassName}): ${doClassName} = {
34 | if (bo == null) return null
35 | val d: ${doClassName} = new ${doClassName}()
36 | <#list columnList as column>
37 | d.set${column.key}(bo.get${column.key}())
38 | #list>
39 | d
40 | }
41 | /**
42 | * change doList to boList
43 | */
44 | def toBOList(doList: util.List[${doClassName}]): util.List[${boClassName}] = {
45 | if(doList == null) {
46 | return new util.ArrayList[${boClassName}]()
47 | }
48 | val boList: util.List[${boClassName}] = new util.ArrayList[${boClassName}]()
49 | doList.foreach(d => {
50 | if(d != null) {
51 | boList.add(${transferClassName}.toBO(d))
52 | }
53 | })
54 | boList
55 | }
56 | /**
57 | * change boList to doList
58 | */
59 | def toDOList(boList: util.List[${boClassName}]): util.List[${doClassName}] = {
60 | if(boList == null) {
61 | return new util.ArrayList[${doClassName}]()
62 | }
63 | val doList: util.List[${doClassName}] = new util.ArrayList[${doClassName}]()
64 | boList.foreach(bo => {
65 | if(bo != null) {
66 | doList.add(${transferClassName}.toDO(bo))
67 | }
68 | })
69 | doList
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.0.jar
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.1-jdk1.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.1-jdk1.6.jar
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.2.jar
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.2.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.2.rar
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.3.jar
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.4.zip
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.5.zip
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.6.zip
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.7.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.7.zip
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.0.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.0.8.zip
--------------------------------------------------------------------------------
/releases/AutoGenerator-1.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/releases/AutoGenerator-1.1.0.zip
--------------------------------------------------------------------------------
/resources/icons/auto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/resources/icons/auto.png
--------------------------------------------------------------------------------
/resources/icons/auto@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/resources/icons/auto@2x.png
--------------------------------------------------------------------------------
/resources/intro/res.properties:
--------------------------------------------------------------------------------
1 | intro = Auto Generator It's a tool for auto generate Data Persistence Layer by Create Table SQL. What is "Data Persistence Layer", just contain DO, Query, DAO, Manager, And sqlmap ... I designed it just for java and scala . other languages maybe later ... The generate code will use ibatis and tddl to access database. If you don't like, change it your self. of course, you also can send other framework to me . \u672C\u5DE5\u5177\u6839\u636E\u5EFA\u8868\u8BED\u53E5\u81EA\u52A8\u521B\u5EFA\u6570\u636E\u6301\u4E45\u5C42. \u6570\u636E\u6301\u4E45\u5C42\u5305\u542BDO, Query, DAO, Manager, sqlmap \u7B49 \u672C\u5DE5\u5177\u53EA\u8BBE\u8BA1\u4E3A\u751F\u6210java\u548Cscala\u4EE3\u7801, \u4E5F\u8BB8\u4EE5\u540E\u4E5F\u4F1A\u6709\u66F4\u591A\u7684\u4EE3\u7801\u652F\u6301 \u672C\u5DE5\u5177\u751F\u6210\u7684\u4EE3\u7801\u9ED8\u8BA4\u4F7F\u7528\u4E86ibastic\u548Ctddl , \u5982\u679C\u4F60\u4E0D\u559C\u6B22, \u8BF7\u81EA\u884C\u751F\u6210\u540E\u66FF\u6362. \u5F53\u7136, \u4E5F\u53EF\u4EE5\u53CD\u9988\u7ED9\u6211, \u5176\u4ED6\u66F4\u597D\u7684\u5EFA\u8BAE.
2 |
--------------------------------------------------------------------------------
/resources/templates/java/basequery.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * BaseQuery
7 | * Date: ${today}
8 | * Generate by autoBaseQuery
9 | * Powered by duxing@Taobao
10 | */
11 |
12 | public class BaseQuery implements Serializable {
13 | private static final long serialVersionUID = 6695437844594466710L;
14 |
15 | private static final Integer DEFAULT_LIMIT = 20;
16 | private static final Integer DEFAULT_CURRENT_PAGE = 1;
17 |
18 | private Integer limit;
19 | private Integer currentPage;
20 |
21 |
22 | public void setCurrentPage(Integer currentPage) {
23 | if(currentPage>0){
24 | this.currentPage = currentPage;
25 | }
26 | }
27 |
28 | public void setLimit(Integer limit) {
29 | if(limit>0){
30 | this.limit = limit;
31 | }
32 | }
33 |
34 | public Integer getStartRow() {
35 | return (getCurrentPage()-1)*getLimit();
36 | }
37 |
38 | public Integer getLimit() {
39 | if(this.limit==null)limit=DEFAULT_LIMIT;
40 | return limit;
41 | }
42 |
43 | public Integer getCurrentPage() {
44 | if(this.currentPage==null)currentPage=DEFAULT_CURRENT_PAGE;
45 | return currentPage;
46 | }
47 | }
--------------------------------------------------------------------------------
/resources/templates/java/bo.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public class ${className}#if($pagerQuery) extends BaseQuery#else implements Serializable#end{
18 | private static final long serialVersionUID = -1L;
19 |
20 | #foreach($!{column} in $!{columnList})
21 | /**
22 | * ${column.comment}
23 | */
24 | private ${column.type} ${column.property};
25 | #end
26 |
27 | #foreach($!{column} in $!{columnList})
28 | /**
29 | * ${column.property} getter & setter
30 | */
31 | public ${column.type} get${column.key}() {
32 | return ${column.property};
33 | }
34 | public void set${column.key}(${column.type} ${column.property}){
35 | this.${column.property} = ${column.property};
36 | }
37 |
38 | #end
39 | }
--------------------------------------------------------------------------------
/resources/templates/java/dao.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | public interface ${className}{
19 |
20 |
21 | /**
22 | * insert one data
23 | *
24 | * @param ${objPropertyName} object
25 | * @return primaryKey ${primaryKeyType}
26 | * @throws Exception exception
27 | */
28 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
29 |
30 | /**
31 | * update data
32 | *
33 | * @param ${objPropertyName} object
34 | * @return update num
35 | * @throws Exception exception
36 | */
37 | public int update(${objClassName} ${objPropertyName}) throws Exception;
38 |
39 | /**
40 | * get an obj
41 | *
42 | * @param ${primaryKeyName} key
43 | * @return obj obj
44 | * @throws Exception exception
45 | */
46 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
47 |
48 | /**
49 | * query a list
50 | *
51 | * @param ${queryPropertyName} query
52 | * @return List
53 | * @throws Exception exception
54 | */
55 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
56 |
57 | /**
58 | * query count
59 | *
60 | * @param ${queryPropertyName} query
61 | * @return Integer
62 | * @throws Exception exception
63 | */
64 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
65 |
66 | /**
67 | #if(${daoLogicDelete})
68 | * logically delete one line
69 | #else
70 | * physically delete one line
71 | #end
72 | *
73 | * @param ${primaryKeyName} key
74 | * @return delete num
75 | * @throws Exception exception
76 | */
77 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
78 |
79 | }
--------------------------------------------------------------------------------
/resources/templates/java/dao.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/resources/templates/java/daoimpl.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | public class ${className} extends BaseDAO implements ${daoClassName}{
19 |
20 | private static final String NAMESPACE = "${daoClassName}.";
21 |
22 | /**
23 | * insert one data
24 | *
25 | * @param ${doPropertyName} object
26 | * @return primaryKey ${primaryKeyType}
27 | * @throws Exception exception
28 | */
29 | public ${primaryKeyType} insert(${doClassName} ${doPropertyName}) throws Exception{
30 | #if($daoUseSequence)
31 | ${primaryKeyType} ${primaryKeyName} = this.getNextId("${tableName}");
32 | ${doPropertyName}.set${primaryKeyNameAtMethod}(${primaryKeyName});
33 | insert(NAMESPACE + "insert", ${doPropertyName});
34 | return ${primaryKeyName};
35 | #else
36 | return insert(NAMESPACE + "insert", ${doPropertyName});
37 | #end
38 | }
39 |
40 | /**
41 | * update data
42 | *
43 | * @param ${doPropertyName} object
44 | * @return update num
45 | * @throws Exception exception
46 | */
47 | public int update(${doClassName} ${doPropertyName}) throws Exception{
48 | return update(NAMESPACE + "update", ${doPropertyName});
49 | }
50 | /**
51 | * get an obj
52 | *
53 | * @param ${primaryKeyName} key
54 | * @return do obj
55 | * @throws Exception exception
56 | */
57 | public ${doClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception{
58 | return (${doClassName}) queryForObject(NAMESPACE + "select", ${primaryKeyName});
59 | }
60 |
61 | /**
62 | * query a list
63 | *
64 | * @param ${queryPropertyName} query
65 | * @return List
66 | * @throws Exception exception
67 | */
68 | @SuppressWarnings("unchecked")
69 | public List<${doClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception{
70 | return (List<${doClassName}>) queryForList(NAMESPACE + "queryList", ${queryPropertyName});
71 | }
72 |
73 | /**
74 | * query count
75 | *
76 | * @param ${queryPropertyName} query
77 | * @return Integer
78 | * @throws Exception exception
79 | */
80 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception{
81 | return (Integer) queryForObject(NAMESPACE + "queryCount", ${queryPropertyName});
82 | }
83 |
84 | /**
85 | #if($daoLogicDelete)
86 | * logically delete one line
87 | #else
88 | * physically delete one line
89 | #end
90 | *
91 | * @param ${primaryKeyName} key
92 | * @return delete num
93 | * @throws Exception exception
94 | */
95 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception{
96 | #if($daoLogicDelete)
97 | return update(NAMESPACE + "delete", ${primaryKeyName});
98 | #else
99 | return delete(NAMESPACE + "delete", ${primaryKeyName});
100 | #end
101 | }
102 |
103 | }
--------------------------------------------------------------------------------
/resources/templates/java/do.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public class ${className}#if($pagerQuery) extends BaseQuery#else implements Serializable#end{
18 | private static final long serialVersionUID = -1L;
19 |
20 | #foreach($!{column} in $!{columnList})
21 | /**
22 | * ${column.comment}
23 | */
24 | private ${column.type} ${column.property};
25 | #end
26 |
27 | #foreach($!{column} in $!{columnList})
28 | /**
29 | * ${column.property} getter & setter
30 | */
31 | public ${column.type} get${column.key}() {
32 | return ${column.property};
33 | }
34 | public void set${column.key}(${column.type} ${column.property}){
35 | this.${column.property} = ${column.property};
36 | }
37 |
38 | #end
39 | }
--------------------------------------------------------------------------------
/resources/templates/java/manager.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public interface ${className}{
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
27 |
28 | /**
29 | * update data
30 | *
31 | * @param ${objPropertyName} object
32 | * @return update num
33 | * @throws Exception exception
34 | */
35 | public int update(${objClassName} ${objPropertyName}) throws Exception;
36 |
37 | /**
38 | * get an obj
39 | *
40 | * @param ${primaryKeyName} key
41 | * @return obj obj
42 | * @throws Exception exception
43 | */
44 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
45 |
46 | /**
47 | * query a list
48 | *
49 | * @param ${queryPropertyName} query
50 | * @return List
51 | * @throws Exception exception
52 | */
53 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
54 |
55 | /**
56 | * query count
57 | *
58 | * @param ${queryPropertyName} query
59 | * @return Integer
60 | * @throws Exception exception
61 | */
62 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
63 |
64 | /**
65 | * logic delete one line
66 | *
67 | * @param ${primaryKeyName} key
68 | * @return delete num
69 | * @throws Exception exception
70 | */
71 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
72 |
73 | }
--------------------------------------------------------------------------------
/resources/templates/java/persistence.xml.vm:
--------------------------------------------------------------------------------
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 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/resources/templates/java/query.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 | /**
9 | * ${className}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | public class ${className}#if($pagerQuery) extends BaseQuery#else implements Serializable#end{
18 | private static final long serialVersionUID = -1L;
19 |
20 | #foreach($!{column} in $!{columnList})
21 | /**
22 | * ${column.comment}
23 | */
24 | private ${column.type} ${column.property};
25 | #end
26 |
27 | #foreach($!{column} in $!{columnList})
28 | /**
29 | * ${column.property} getter & setter
30 | */
31 | public ${column.type} get${column.key}() {
32 | return ${column.property};
33 | }
34 | public void set${column.key}(${column.type} ${column.property}){
35 | this.${column.property} = ${column.property};
36 | }
37 |
38 | #end
39 | }
--------------------------------------------------------------------------------
/resources/templates/java/sqlmap-config.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/resources/templates/java/transfer.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import};
6 | #end
7 | #end
8 |
9 | /**
10 | * ${transferClassName}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | public class ${transferClassName}{
19 |
20 | public static ${boClassName} toBO(${doClassName} d) {
21 | if (d == null) return null;
22 | ${boClassName} bo = new ${boClassName}();
23 | #foreach($!{column} in $!{columnList})
24 | bo.set${column.key}(d.get${column.key}());
25 | #end
26 | return bo;
27 | }
28 |
29 | public static ${doClassName} toDO(${boClassName} bo) {
30 | if (bo == null) return null;
31 | ${doClassName} d = new ${doClassName}();
32 | #foreach($!{column} in $!{columnList})
33 | d.set${column.key}(bo.get${column.key}());
34 | #end
35 | return d;
36 | }
37 |
38 | public static List<${boClassName}> toBOList(List<${doClassName}> doList){
39 | if(doList == null) {
40 | return new ArrayList<${boClassName}>();
41 | }
42 | List<${boClassName}> boList = new ArrayList<${boClassName}>();
43 | for(${doClassName} d : doList) {
44 | if(d != null) {
45 | boList.add(${transferClassName}.toBO(d));
46 | }
47 | }
48 | return boList;
49 | }
50 |
51 | public static List<${doClassName}> toDOList(List<${boClassName}> boList){
52 | if(boList == null) {
53 | return new ArrayList<${doClassName}>();
54 | }
55 | List<${doClassName}> doList = new ArrayList<${doClassName}>();
56 | for(${boClassName} bo : boList) {
57 | if(bo != null) {
58 | doList.add(${transferClassName}.toDO(bo));
59 | }
60 | }
61 | return doList;
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/resources/templates/scala/basequery.vm:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * BaseQuery
7 | * Date: ${today}
8 | * Generate by autoBaseQuery
9 | * Powered by duxing@Taobao
10 | */
11 |
12 | public class BaseQuery implements Serializable {
13 | private static final long serialVersionUID = 6695437844594466710L;
14 |
15 | private static final Integer DEFAULT_LIMIT = 20;
16 | private static final Integer DEFAULT_CURRENT_PAGE = 1;
17 |
18 | private Integer limit;
19 | private Integer currentPage;
20 |
21 |
22 | public void setCurrentPage(Integer currentPage) {
23 | if(currentPage>0){
24 | this.currentPage = currentPage;
25 | }
26 | }
27 |
28 | public void setLimit(Integer limit) {
29 | if(limit>0){
30 | this.limit = limit;
31 | }
32 | }
33 |
34 | public Integer getStartRow() {
35 | return (getCurrentPage()-1)*getLimit();
36 | }
37 |
38 | public Integer getLimit() {
39 | if(this.limit==null)limit=DEFAULT_LIMIT;
40 | return limit;
41 | }
42 |
43 | public Integer getCurrentPage() {
44 | if(this.currentPage==null)currentPage=DEFAULT_CURRENT_PAGE;
45 | return currentPage;
46 | }
47 | }
--------------------------------------------------------------------------------
/resources/templates/scala/bo.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | #foreach($import in $!{importList})
6 | #if("$!{import}"!="")
7 | import $!{import}
8 | #end
9 | #end
10 |
11 | /**
12 | * ${className}
13 | *
14 | * User: ${user}
15 | * Date: ${today}
16 | * Generate by ${autoName}
17 | * Powered by duxing@Taobao
18 | */
19 | @SerialVersionUID(-1L)
20 | class ${className}#if($pagerQuery) extends BaseQuery#else extends Serializable#end{
21 |
22 | #foreach($!{column} in $!{columnList})
23 | /**
24 | * ${column.comment}
25 | */
26 | @BeanProperty var ${column.property}: ${column.type} = _
27 | #end
28 |
29 | }
--------------------------------------------------------------------------------
/resources/templates/scala/dao.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | trait ${className} extends BaseDAO{
19 |
20 |
21 | /**
22 | * insert one data
23 | *
24 | * @param ${objPropertyName} object
25 | * @return primaryKey ${primaryKeyType}
26 | * @throws Exception exception
27 | */
28 | @throws(classOf[Exception])
29 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
30 |
31 | /**
32 | * update data
33 | *
34 | * @param ${objPropertyName} object
35 | * @return update num
36 | * @throws Exception exception
37 | */
38 | @throws(classOf[Exception])
39 | def update(${objPropertyName}: ${objClassName}): Int
40 |
41 | /**
42 | * get an obj
43 | *
44 | * @param ${primaryKeyName} key
45 | * @return obj obj
46 | * @throws Exception exception
47 | */
48 | @throws(classOf[Exception])
49 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
50 |
51 | /**
52 | * query a list
53 | *
54 | * @param ${queryPropertyName} query
55 | * @return List
56 | * @throws Exception exception
57 | */
58 | @throws(classOf[Exception])
59 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
60 |
61 | /**
62 | * query count
63 | *
64 | * @param ${queryPropertyName} query
65 | * @return Integer
66 | * @throws Exception exception
67 | */
68 | @throws(classOf[Exception])
69 | def getCount(${queryPropertyName}: ${queryClassName}): Int
70 |
71 | /**
72 | #if($daoLogicDelete)
73 | * logically delete one line
74 | #else
75 | * physically delete one line
76 | #end
77 | *
78 | * @param ${primaryKeyName} key
79 | * @return delete num
80 | * @throws Exception exception
81 | */
82 | @throws(classOf[Exception])
83 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
84 |
85 | }
--------------------------------------------------------------------------------
/resources/templates/scala/dao.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/resources/templates/scala/do.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | #foreach($import in $!{importList})
6 | #if("$!{import}"!="")
7 | import $!{import}
8 | #end
9 | #end
10 |
11 | /**
12 | * ${className}
13 | *
14 | * User: ${user}
15 | * Date: ${today}
16 | * Generate by ${autoName}
17 | * Powered by duxing@Taobao
18 | */
19 | @SerialVersionUID(-1L)
20 | class ${className}#if($pagerQuery) extends BaseQuery#else extends Serializable#end{
21 |
22 | #foreach($!{column} in $!{columnList})
23 | /**
24 | * ${column.comment}
25 | */
26 | @BeanProperty var ${column.property}: ${column.type} = _
27 | #end
28 |
29 | }
--------------------------------------------------------------------------------
/resources/templates/scala/manager.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 |
18 | trait ${className}{
19 |
20 | /**
21 | * insert one data
22 | *
23 | * @param ${objPropertyName} object
24 | * @return primaryKey ${primaryKeyType}
25 | * @throws Exception exception
26 | */
27 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
28 |
29 | /**
30 | * update data
31 | *
32 | * @param ${objPropertyName} object
33 | * @return update num
34 | * @throws Exception exception
35 | */
36 | def update(${objPropertyName}: ${objClassName}): Int
37 |
38 | /**
39 | * get an obj
40 | *
41 | * @param ${primaryKeyName} key
42 | * @return obj obj
43 | * @throws Exception exception
44 | */
45 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
46 |
47 | /**
48 | * query a list
49 | *
50 | * @param ${queryPropertyName} query
51 | * @return List
52 | * @throws Exception exception
53 | */
54 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
55 |
56 | /**
57 | * query count
58 | *
59 | * @param ${queryPropertyName} query
60 | * @return Integer
61 | * @throws Exception exception
62 | */
63 | def getCount(${queryPropertyName}: ${queryClassName}): Int
64 |
65 | /**
66 | * logic delete one line
67 | *
68 | * @param ${primaryKeyName} key
69 | * @return delete num
70 | * @throws Exception exception
71 | */
72 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
73 |
74 | }
--------------------------------------------------------------------------------
/resources/templates/scala/persistence.xml.vm:
--------------------------------------------------------------------------------
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 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/resources/templates/scala/query.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | #foreach($import in $!{importList})
6 | #if("$!{import}"!="")
7 | import $!{import}
8 | #end
9 | #end
10 |
11 | /**
12 | * ${className}
13 | *
14 | * User: ${user}
15 | * Date: ${today}
16 | * Generate by ${autoName}
17 | * Powered by duxing@Taobao
18 | */
19 | @SerialVersionUID(-1L)
20 | class ${className}#if($pagerQuery) extends BaseQuery#else extends Serializable#end{
21 |
22 | #foreach($!{column} in $!{columnList})
23 | /**
24 | * ${column.comment}
25 | */
26 | @BeanProperty var ${column.property}: ${column.type} = _
27 | #end
28 |
29 | }
--------------------------------------------------------------------------------
/resources/templates/scala/sqlmap-config.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/resources/templates/scala/transfer.vm:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | #foreach($import in $!{importList})
4 | #if("$!{import}"!="")
5 | import $!{import}
6 | #end
7 | #end
8 | import scala.collection.JavaConversions._
9 |
10 | /**
11 | * ${transferClassName}
12 | *
13 | * User: ${user}
14 | * Date: ${today}
15 | * Generate by ${autoName}
16 | * Powered by duxing@Taobao
17 | */
18 | object ${transferClassName}{
19 | /**
20 | * change do to bo
21 | */
22 | def toBO(d: ${doClassName}): ${boClassName} = {
23 | if (d == null) return null
24 | val bo: ${boClassName} = new ${boClassName}()
25 | #foreach($!{column} in $!{columnList})
26 | bo.set${column.key}(d.get${column.key}())
27 | #end
28 | bo
29 | }
30 |
31 | /**
32 | * change bo to do
33 | */
34 | def toDO(bo: ${boClassName}): ${doClassName} = {
35 | if (bo == null) return null
36 | val d: ${doClassName} = new ${doClassName}()
37 | #foreach($!{column} in $!{columnList})
38 | d.set${column.key}(bo.get${column.key}())
39 | #end
40 | d
41 | }
42 | /**
43 | * change doList to boList
44 | */
45 | def toBOList(doList: util.List[${doClassName}]): util.List[${boClassName}] = {
46 | if(doList == null) {
47 | return new util.ArrayList[${boClassName}]()
48 | }
49 | val boList: util.List[${boClassName}] = new util.ArrayList[${boClassName}]()
50 | doList.foreach(d => {
51 | if(d != null) {
52 | boList.add(${transferClassName}.toBO(d))
53 | }
54 | })
55 | boList
56 | }
57 | /**
58 | * change boList to doList
59 | */
60 | def toDOList(boList: util.List[${boClassName}]): util.List[${doClassName}] = {
61 | if(boList == null) {
62 | return new util.ArrayList[${doClassName}]()
63 | }
64 | val doList: util.List[${doClassName}] = new util.ArrayList[${doClassName}]()
65 | boList.foreach(bo => {
66 | if(bo != null) {
67 | doList.add(${transferClassName}.toDO(bo))
68 | }
69 | })
70 | doList
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/resources/tpl/java/basequery.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * BaseQuery
7 | * Date: ${today}
8 | * Generate by autoBaseQuery
9 | * Powered by duxing@Taobao
10 | */
11 |
12 | public class BaseQuery implements Serializable {
13 | private static final long serialVersionUID = 6695437844594466710L;
14 |
15 | private static final Integer DEFAULT_LIMIT = 20;
16 | private static final Integer DEFAULT_CURRENT_PAGE = 1;
17 |
18 | private Integer limit;
19 | private Integer currentPage;
20 |
21 |
22 | public void setCurrentPage(Integer currentPage) {
23 | if(currentPage>0){
24 | this.currentPage = currentPage;
25 | }
26 | }
27 |
28 | public void setLimit(Integer limit) {
29 | if(limit>0){
30 | this.limit = limit;
31 | }
32 | }
33 |
34 | public Integer getStartRow() {
35 | return (getCurrentPage()-1)*getLimit();
36 | }
37 |
38 | public Integer getLimit() {
39 | if(this.limit==null)limit=DEFAULT_LIMIT;
40 | return limit;
41 | }
42 |
43 | public Integer getCurrentPage() {
44 | if(this.currentPage==null)currentPage=DEFAULT_CURRENT_PAGE;
45 | return currentPage;
46 | }
47 | }
--------------------------------------------------------------------------------
/resources/tpl/java/dao.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public interface ${className}{
17 |
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
27 |
28 | /**
29 | * update data
30 | *
31 | * @param ${objPropertyName} object
32 | * @return update num
33 | * @throws Exception exception
34 | */
35 | public int update(${objClassName} ${objPropertyName}) throws Exception;
36 |
37 | /**
38 | * get an obj
39 | *
40 | * @param ${primaryKeyName} key
41 | * @return obj obj
42 | * @throws Exception exception
43 | */
44 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
45 |
46 | /**
47 | * query a list
48 | *
49 | * @param ${queryPropertyName} query
50 | * @return List
51 | * @throws Exception exception
52 | */
53 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
54 |
55 | /**
56 | * query count
57 | *
58 | * @param ${queryPropertyName} query
59 | * @return Integer
60 | * @throws Exception exception
61 | */
62 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
63 |
64 | /**
65 | <#if daoLogicDelete>
66 | * logically delete one line
67 | <#else>
68 | * physically delete one line
69 | #if>
70 | *
71 | * @param ${primaryKeyName} key
72 | * @return delete num
73 | * @throws Exception exception
74 | */
75 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
76 |
77 | }
--------------------------------------------------------------------------------
/resources/tpl/java/daoxml-line.ftl:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/resources/tpl/java/daoxml.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <#include "/tpl/java/daoxml-line.ftl">
7 |
8 |
9 |
--------------------------------------------------------------------------------
/resources/tpl/java/do.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public class ${className} <#if pagerQuery>extends BaseQuery<#else>implements Serializable#if>{
17 | private static final long serialVersionUID = -1L;
18 |
19 | <#list columnList as column>
20 | /**
21 | * ${column.comment}
22 | */
23 | private ${column.type} ${column.property};
24 | #list>
25 |
26 | <#list columnList as column>
27 | /**
28 | * ${column.property} getter & setter
29 | */
30 | public ${column.type} get${column.key}() {
31 | return ${column.property};
32 | }
33 | public void set${column.key}(${column.type} ${column.property}){
34 | this.${column.property} = ${column.property};
35 | }
36 |
37 | #list>
38 | }
--------------------------------------------------------------------------------
/resources/tpl/java/manager.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public interface ${className}{
17 |
18 | /**
19 | * insert one data
20 | *
21 | * @param ${objPropertyName} object
22 | * @return primaryKey ${primaryKeyType}
23 | * @throws Exception exception
24 | */
25 | public ${primaryKeyType} insert(${objClassName} ${objPropertyName}) throws Exception;
26 |
27 | /**
28 | * update data
29 | *
30 | * @param ${objPropertyName} object
31 | * @return update num
32 | * @throws Exception exception
33 | */
34 | public int update(${objClassName} ${objPropertyName}) throws Exception;
35 |
36 | /**
37 | * get an obj
38 | *
39 | * @param ${primaryKeyName} key
40 | * @return obj obj
41 | * @throws Exception exception
42 | */
43 | public ${objClassName} get(${primaryKeyType} ${primaryKeyName}) throws Exception;
44 |
45 | /**
46 | * query a list
47 | *
48 | * @param ${queryPropertyName} query
49 | * @return List
50 | * @throws Exception exception
51 | */
52 | public List<${objClassName}> getList(${queryClassName} ${queryPropertyName}) throws Exception;
53 |
54 | /**
55 | * query count
56 | *
57 | * @param ${queryPropertyName} query
58 | * @return Integer
59 | * @throws Exception exception
60 | */
61 | public Integer getCount(${queryClassName} ${queryPropertyName}) throws Exception;
62 |
63 | /**
64 | * logic delete one line
65 | *
66 | * @param ${primaryKeyName} key
67 | * @return delete num
68 | * @throws Exception exception
69 | */
70 | public int delete(${primaryKeyType} ${primaryKeyName}) throws Exception;
71 |
72 | }
--------------------------------------------------------------------------------
/resources/tpl/java/persistence.ftl:
--------------------------------------------------------------------------------
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 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/resources/tpl/java/sqlmapconfig.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/resources/tpl/java/transfer.ftl:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | <#list importList as import>
4 | import ${import};
5 | #list>
6 |
7 | /**
8 | * ${transferClassName}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | public class ${transferClassName}{
17 |
18 | public static ${boClassName} toBO(${doClassName} d) {
19 | if (d == null) return null;
20 | ${boClassName} bo = new ${boClassName}();
21 | <#list columnList as column>
22 | bo.set${column.key}(d.get${column.key}());
23 | #list>
24 | return bo;
25 | }
26 |
27 | public static ${doClassName} toDO(${boClassName} bo) {
28 | if (bo == null) return null;
29 | ${doClassName} d = new ${doClassName}();
30 | <#list columnList as column>
31 | d.set${column.key}(bo.get${column.key}());
32 | #list>
33 | return d;
34 | }
35 |
36 | public static List<${boClassName}> toBOList(List<${doClassName}> doList){
37 | if(doList == null) {
38 | return new ArrayList<${boClassName}>();
39 | }
40 | List<${boClassName}> boList = new ArrayList<${boClassName}>();
41 | for(${doClassName} d : doList) {
42 | if(d != null) {
43 | boList.add(${transferClassName}.toBO(d));
44 | }
45 | }
46 | return boList;
47 | }
48 |
49 | public static List<${doClassName}> toDOList(List<${boClassName}> boList){
50 | if(boList == null) {
51 | return new ArrayList<${doClassName}>();
52 | }
53 | List<${doClassName}> doList = new ArrayList<${doClassName}>();
54 | for(${boClassName} bo : boList) {
55 | if(bo != null) {
56 | doList.add(${transferClassName}.toDO(bo));
57 | }
58 | }
59 | return doList;
60 | }
61 |
62 | }
--------------------------------------------------------------------------------
/resources/tpl/scala/dao.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | trait ${className} extends BaseDAO{
17 |
18 |
19 | /**
20 | * insert one data
21 | *
22 | * @param ${objPropertyName} object
23 | * @return primaryKey ${primaryKeyType}
24 | * @throws Exception exception
25 | */
26 | @throws(classOf[Exception])
27 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
28 |
29 | /**
30 | * update data
31 | *
32 | * @param ${objPropertyName} object
33 | * @return update num
34 | * @throws Exception exception
35 | */
36 | @throws(classOf[Exception])
37 | def update(${objPropertyName}: ${objClassName}): Int
38 |
39 | /**
40 | * get an obj
41 | *
42 | * @param ${primaryKeyName} key
43 | * @return obj obj
44 | * @throws Exception exception
45 | */
46 | @throws(classOf[Exception])
47 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
48 |
49 | /**
50 | * query a list
51 | *
52 | * @param ${queryPropertyName} query
53 | * @return List
54 | * @throws Exception exception
55 | */
56 | @throws(classOf[Exception])
57 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
58 |
59 | /**
60 | * query count
61 | *
62 | * @param ${queryPropertyName} query
63 | * @return Integer
64 | * @throws Exception exception
65 | */
66 | @throws(classOf[Exception])
67 | def getCount(${queryPropertyName}: ${queryClassName}): Int
68 |
69 | /**
70 | <#if daoLogicDelete>
71 | * logically delete one line
72 | <#else>
73 | * physically delete one line
74 | #if>
75 | *
76 | * @param ${primaryKeyName} key
77 | * @return delete num
78 | * @throws Exception exception
79 | */
80 | @throws(classOf[Exception])
81 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
82 |
83 | }
--------------------------------------------------------------------------------
/resources/tpl/scala/do.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | import scala.beans.BeanProperty
4 | import java.util
5 | <#list importList as import>
6 | import ${import}
7 | #list>
8 |
9 | /**
10 | * ${className}
11 | *
12 | * User: ${user}
13 | * Date: ${today}
14 | * Generate by ${autoName}
15 | * Powered by duxing@Taobao
16 | */
17 | @SerialVersionUID(-1L)
18 | class ${className} <#if pagerQuery>extends BaseQuery<#else>extends Serializable#if>{
19 |
20 | <#list columnList as column>
21 | /**
22 | * ${column.comment}
23 | */
24 | @BeanProperty var ${column.property}: ${column.type} = _
25 | #list>
26 |
27 | }
--------------------------------------------------------------------------------
/resources/tpl/scala/manager.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 |
7 | /**
8 | * ${className}
9 | *
10 | * User: ${user}
11 | * Date: ${today}
12 | * Generate by ${autoName}
13 | * Powered by duxing@Taobao
14 | */
15 |
16 | trait ${className}{
17 |
18 | /**
19 | * insert one data
20 | *
21 | * @param ${objPropertyName} object
22 | * @return primaryKey ${primaryKeyType}
23 | * @throws Exception exception
24 | */
25 | def insert(${objPropertyName}: ${objClassName}): ${primaryKeyType}
26 |
27 | /**
28 | * update data
29 | *
30 | * @param ${objPropertyName} object
31 | * @return update num
32 | * @throws Exception exception
33 | */
34 | def update(${objPropertyName}: ${objClassName}): Int
35 |
36 | /**
37 | * get an obj
38 | *
39 | * @param ${primaryKeyName} key
40 | * @return obj obj
41 | * @throws Exception exception
42 | */
43 | def get(${primaryKeyName}: ${primaryKeyType}): ${objClassName}
44 |
45 | /**
46 | * query a list
47 | *
48 | * @param ${queryPropertyName} query
49 | * @return List
50 | * @throws Exception exception
51 | */
52 | def getList(${queryPropertyName}: ${queryClassName}): util.List[${objClassName}]
53 |
54 | /**
55 | * query count
56 | *
57 | * @param ${queryPropertyName} query
58 | * @return Integer
59 | * @throws Exception exception
60 | */
61 | def getCount(${queryPropertyName}: ${queryClassName}): Int
62 |
63 | /**
64 | * logic delete one line
65 | *
66 | * @param ${primaryKeyName} key
67 | * @return delete num
68 | * @throws Exception exception
69 | */
70 | def delete(${primaryKeyName}: ${primaryKeyType}): Int
71 |
72 | }
--------------------------------------------------------------------------------
/resources/tpl/scala/transfer.ftl:
--------------------------------------------------------------------------------
1 | package ${package}
2 |
3 | <#list importList as import>
4 | import ${import}
5 | #list>
6 | import scala.collection.JavaConversions._
7 |
8 | /**
9 | * ${transferClassName}
10 | *
11 | * User: ${user}
12 | * Date: ${today}
13 | * Generate by ${autoName}
14 | * Powered by duxing@Taobao
15 | */
16 |
17 | object ${transferClassName}{
18 | /**
19 | * change do to bo
20 | */
21 | def toBO(d: ${doClassName}): ${boClassName} = {
22 | if (d == null) return null
23 | val bo: ${boClassName} = new ${boClassName}()
24 | <#list columnList as column>
25 | bo.set${column.key}(d.get${column.key}())
26 | #list>
27 | bo
28 | }
29 |
30 | /**
31 | * change bo to do
32 | */
33 | def toDO(bo: ${boClassName}): ${doClassName} = {
34 | if (bo == null) return null
35 | val d: ${doClassName} = new ${doClassName}()
36 | <#list columnList as column>
37 | d.set${column.key}(bo.get${column.key}())
38 | #list>
39 | d
40 | }
41 | /**
42 | * change doList to boList
43 | */
44 | def toBOList(doList: util.List[${doClassName}]): util.List[${boClassName}] = {
45 | if(doList == null) {
46 | return new util.ArrayList[${boClassName}]()
47 | }
48 | val boList: util.List[${boClassName}] = new util.ArrayList[${boClassName}]()
49 | doList.foreach(d => {
50 | if(d != null) {
51 | boList.add(${transferClassName}.toBO(d))
52 | }
53 | })
54 | boList
55 | }
56 | /**
57 | * change boList to doList
58 | */
59 | def toDOList(boList: util.List[${boClassName}]): util.List[${doClassName}] = {
60 | if(boList == null) {
61 | return new util.ArrayList[${doClassName}]()
62 | }
63 | val doList: util.List[${doClassName}] = new util.ArrayList[${doClassName}]()
64 | boList.foreach(bo => {
65 | if(bo != null) {
66 | doList.add(${transferClassName}.toDO(bo))
67 | }
68 | })
69 | doList
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/ShowDialog.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.Env;
4 | import cn.fishy.plugin.idea.auto.ui.GeneratorMainDialog;
5 | import com.intellij.openapi.actionSystem.AnActionEvent;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.11 1:34
10 | */
11 | public class ShowDialog extends com.intellij.openapi.actionSystem.AnAction {
12 |
13 | @Override
14 | public void actionPerformed(AnActionEvent e) {
15 | Env.project = e.getProject();
16 | GeneratorMainDialog dialog = new GeneratorMainDialog();
17 | dialog.pack();
18 | dialog.setVisible(true);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/constant/ColumnEnum.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.constant;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.14 1:25
9 | */
10 | public enum ColumnEnum {
11 | No("No",0),
12 | DO("DO",1),
13 | Query("Query",2),
14 | Column("Column",3),
15 | DBType("DBType",4),
16 | CodeType("CodeType",5),
17 | ClassProperty("ClassProperty",6),
18 | Primary("Primary",7),
19 | Comment("Comment",8);
20 | private String name;
21 | private int order;
22 |
23 | ColumnEnum(String name, int order) {
24 | this.name = name;
25 | this.order = order;
26 | }
27 |
28 | public static List getColumnNameList(){
29 | List list = new ArrayList();
30 | for(ColumnEnum c : ColumnEnum.values()){
31 | list.add(c.getName());
32 | }
33 | return list;
34 | }
35 |
36 | public static String[] getColumnNames(){
37 | List list = getColumnNameList();
38 | return list.toArray(new String[list.size()]);
39 | }
40 |
41 | public static ColumnEnum get(String name){
42 | if(name==null)return null;
43 | for(ColumnEnum c:ColumnEnum.values()){
44 | if(name.toLowerCase().equals(c.getName().toLowerCase())){
45 | return c;
46 | }
47 | }
48 | return null;
49 | }
50 |
51 | public static ColumnEnum getByOrder(int order){
52 | for(ColumnEnum c:ColumnEnum.values()){
53 | if(order==c.getOrder()){
54 | return c;
55 | }
56 | }
57 | return null;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public int getOrder() {
65 | return order;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/constant/GenerateType.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.constant;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.Env;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.14 1:25
8 | */
9 |
10 | public enum GenerateType {
11 | DO("DO","DO","dal/dataobject/","dal.dataobject",TypePath.SRC),
12 | BO("BO","BO","bo/","bo",TypePath.SRC),
13 | Query("Query","Query","dal/query/","dal.query",TypePath.SRC),
14 | SQLMap("SQLMap","_sqlmap","dal/sqlmap/","dal.dataobject",TypePath.RESOURCES),
15 | DAO("DAO","DAO","dal/dao/","dal.dao",TypePath.SRC),
16 | DAOImpl("DAOImpl","DAOImpl","dal/dao/impl/","dal.dao.impl",TypePath.SRC),
17 | Manager("Manager","Manager","manager/","manager",TypePath.SRC),
18 | ManagerImpl("ManagerImpl","ManagerImpl","manager/impl/","manager.impl",TypePath.SRC),
19 | Transfer("Transfer","Transfer","transfer/","transfer",TypePath.SRC),
20 | BaseDAO("BaseDAO","BaseDAO","dal/dao/","dal.dao",TypePath.SRC),
21 | BaseQuery("BaseQuery","BaseQuery","dal/query/","dal.query",TypePath.SRC),
22 | DAOXml("DAO.Xml","dao-sample","dal/","dal.dao.impl",TypePath.RESOURCES),
23 | SQLMapConfigXml("SQLMap-Config.Xml","sqlmap-config-sample","dal/","dal",TypePath.RESOURCES),
24 | PersistenceXml("Persistence.Xml","persistence-sample","dal/","dal.dao",TypePath.RESOURCES),
25 | ALL("All","All","","",null);
26 | private String name;
27 | private String suffix;
28 | private String path;
29 | private String pkg;
30 | private TypePath typePath;
31 |
32 | GenerateType(String name, String suffix, String path, String pkg,TypePath typePath) {
33 | this.name = name;
34 | this.suffix = suffix;
35 | this.path = path;
36 | this.pkg = pkg;
37 | this.typePath = typePath;
38 | }
39 |
40 | public static GenerateType get(String name){
41 | if(name==null)return null;
42 | for(GenerateType c: GenerateType.values()){
43 | if(name.toLowerCase().equals(c.getName().toLowerCase())){
44 | return c;
45 | }
46 | }
47 | return null;
48 | }
49 |
50 | public static GenerateType getBySuffix(String suffix){
51 | if(suffix==null)return null;
52 | for(GenerateType c: GenerateType.values()){
53 | if(c.getSuffix().toLowerCase().equals(suffix.toLowerCase())){
54 | return c;
55 | }
56 | }
57 | return null;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public String getSuffix() {
65 | return suffix;
66 | }
67 |
68 | public String getPath() {
69 | if("/".equals(Env.sp)){ //mac linux
70 | return path;
71 | }else{ //widows
72 | return path.replaceAll("\\/","\\"+Env.sp);
73 | }
74 | }
75 |
76 | public String getPkg() {
77 | return pkg;
78 | }
79 |
80 | public TypePath getTypePath() {
81 | return typePath;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/constant/ImportMapHolder.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.constant;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 |
5 | import java.util.ArrayList;
6 | import java.util.HashMap;
7 | import java.util.List;
8 | import java.util.Map;
9 |
10 | /**
11 | * User: duxing
12 | * Date: 2015-08-15 16:41
13 | */
14 | public class ImportMapHolder {
15 | public static Map importMap = new HashMap();
16 | public static List javaIgnoreTypeList = new ArrayList();
17 | static{
18 | importMap.put("Date", "java.util.Date");
19 | importMap.put("Long", "java.lang.Long");
20 | importMap.put("Integer", "java.lang.Integer");
21 | importMap.put("BigDecimal", "java.math.BigDecimal");
22 | javaIgnoreTypeList.add("Long");
23 | javaIgnoreTypeList.add("Integer");
24 | }
25 |
26 | public static String getImport(String type,Code code){
27 | String r = importMap.get(type);
28 | if(code.equals(Code.JAVA) && javaIgnoreTypeList.contains(type)){
29 | return null;
30 | }
31 | return r;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/constant/TypePath.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.constant;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.17 22:30
6 | */
7 | public enum TypePath{
8 | SRC("src"),RESOURCES("resources");
9 | private String path;
10 |
11 | TypePath(String path) {
12 | this.path = path;
13 | }
14 |
15 | public String getPath() {
16 | return path;
17 | }
18 |
19 | public boolean isSrc(){
20 | return this.path.equals("src");
21 | }
22 |
23 | public boolean isResources(){
24 | return this.path.equals("resources");
25 | }
26 | }
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/Code.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.12 2:09
6 | */
7 | public enum Code {
8 | JAVA("JAVA",".java","src/main/java","src/test/java","src/main/resources"),SCALA("SCALA",".scala","src/main/scala","src/test/scala","src/main/resources");
9 | private String name;
10 | private String ext;
11 | private String sign;
12 | private String signTest;
13 | private String resources;
14 |
15 | Code(String name,String ext,String sign,String signTest,String resources) {
16 | this.name = name;
17 | this.ext = ext;
18 | this.sign = sign;
19 | this.signTest = signTest;
20 | this.resources = resources;
21 | }
22 |
23 | public String getExt() {
24 | return ext;
25 | }
26 |
27 | public String getName() {
28 | return name;
29 | }
30 |
31 | public String getTplPath() {
32 | return name.toLowerCase()+"/";
33 | }
34 |
35 | public String getSign() {
36 | return sign;
37 | }
38 |
39 | public String getResources() {
40 | return resources;
41 | }
42 |
43 | public static Code get(String c){
44 | if(c==null)return null;
45 | for(Code code:Code.values()){
46 | if(code.getName().toLowerCase().equals(c.toLowerCase())){
47 | return code;
48 | }
49 | }
50 | return null;
51 | }
52 |
53 | public String getSignTest() {
54 | return signTest;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/Encoding.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.12 2:09
6 | */
7 | public enum Encoding {
8 | UTF8("UTF-8"),GBK("GBK");
9 | private String name;
10 |
11 | Encoding(String name) {
12 | this.name = name;
13 | }
14 |
15 | public String getName() {
16 | return name;
17 | }
18 |
19 | public static Encoding get(String name){
20 | if(name==null)return null;
21 | for(Encoding e:Encoding.values()){
22 | if(e.getName().equals(name)){
23 | return e;
24 | }
25 | }
26 | return null;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/Language.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.12 2:09
6 | */
7 | public enum Language {
8 | CHS("Chinese"),EN("English");
9 | private String name;
10 |
11 | Language(String name) {
12 | this.name = name;
13 | }
14 |
15 | public String getName() {
16 | return name;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/PomNamespaceContext.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | import javax.xml.XMLConstants;
4 | import javax.xml.namespace.NamespaceContext;
5 | import java.util.Iterator;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.12 2:09
10 | */
11 |
12 | public class PomNamespaceContext implements NamespaceContext {
13 |
14 | @Override
15 | public String getNamespaceURI(String prefix) {
16 | if (prefix == null) throw new NullPointerException("Null prefix");
17 | else if ("ns".equals(prefix)) return "http://maven.apache.org/POM/4.0.0";
18 | else if ("xsi".equals(prefix)) return "http://www.w3.org/2001/XMLSchema-instance";
19 | else if ("schema".equals(prefix)) return "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";
20 | else if ("xml".equals(prefix)) return XMLConstants.XML_NS_URI;
21 | return XMLConstants.NULL_NS_URI;
22 | }
23 |
24 | @Override
25 | public String getPrefix(String namespaceURI) {
26 | return null;
27 | }
28 |
29 | @Override
30 | public Iterator getPrefixes(String namespaceURI) {
31 | return null;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/SqlInfo.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | import org.apache.commons.lang.StringUtils;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 2:08
10 | */
11 | public class SqlInfo {
12 | private String tableName;
13 | private String primaryKey;
14 | private List columnList;
15 |
16 | public SqlInfo() {
17 | }
18 |
19 | public SqlInfo(String tableName, String primaryKey, List columnList) {
20 | this.tableName = tableName;
21 | this.primaryKey = primaryKey;
22 | this.columnList = columnList;
23 | }
24 |
25 | public String getTableName() {
26 | return tableName;
27 | }
28 |
29 | public void setTableName(String tableName) {
30 | this.tableName = tableName;
31 | }
32 |
33 | public String getPrimaryKey() {
34 | return primaryKey;
35 | }
36 |
37 | public void setPrimaryKey(String primaryKey) {
38 | this.primaryKey = primaryKey;
39 | }
40 |
41 | public List getColumnList() {
42 | return columnList;
43 | }
44 |
45 | public void setColumnList(List columnList) {
46 | this.columnList = columnList;
47 | }
48 |
49 | public boolean isValid() {
50 | return this.columnList!=null && this.columnList.size()>0 && StringUtils.isNotBlank(tableName);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/domain/TemplateConfig.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.domain;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.storage.PluginConfigHolder;
5 | import cn.fishy.plugin.idea.auto.storage.domain.PluginConfig;
6 | import com.intellij.notification.EventLog;
7 | import com.intellij.openapi.diagnostic.Logger;
8 |
9 | import java.io.File;
10 |
11 | /**
12 | * User: duxing
13 | * Date: 2016-05-04 16:42
14 | */
15 | public class TemplateConfig {
16 |
17 | private static final Logger logger = Logger.getInstance(TemplateConfig.class);
18 |
19 | public static final String TEMPLATE_EXT = ".vm";
20 | public static String TEMPLATE_DIR = "templates/";
21 |
22 | public static String getTemplatePath() {
23 | PluginConfig pluginConfig = PluginConfigHolder.getPluginConfig();
24 | if(pluginConfig!=null){
25 | if(pluginConfig.tplUseCustom && pluginConfig.tplPathCustom!=null && !pluginConfig.tplPathCustom.equals("")){
26 | File path = new File(pluginConfig.tplPathCustom);
27 | if(path.exists()){
28 | if(!pluginConfig.tplPathCustom.endsWith("/"))pluginConfig.tplPathCustom+="/";
29 | return pluginConfig.tplPathCustom;
30 | }else{
31 | logger.error("path: "+ pluginConfig.tplPathCustom +" is not exist!");
32 | }
33 | }
34 | }
35 | return TEMPLATE_DIR;
36 | }
37 |
38 | public static String getTemplate(String tpl) {
39 | return getTemplatePath() + tpl + TEMPLATE_EXT;
40 | }
41 |
42 | public static String getTemplate(Code code, GenerateType generateType) {
43 | return getTemplatePath() + code.getTplPath() + generateType.getName().toLowerCase() + TEMPLATE_EXT;
44 | }
45 |
46 | public static String getOriginTemplate(Code code, GenerateType generateType) {
47 | return TEMPLATE_DIR + code.getTplPath() + generateType.getName().toLowerCase() + TEMPLATE_EXT;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/BoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 1:36
10 | */
11 | public interface BoGenerator {
12 | public String generate(String boClassName, List columnList);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/CodeAbstractGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 | import com.intellij.openapi.util.io.FileUtil;
5 |
6 | import java.io.File;
7 | import java.io.IOException;
8 | import java.util.List;
9 |
10 | /**
11 | * User: duxing
12 | * Date: 2015.08.13 23:33
13 | */
14 | public abstract class CodeAbstractGenerator {
15 |
16 | public abstract String space();
17 | public String br(){
18 | return "\r\n";
19 | }
20 |
21 | public abstract String generateDO(String doClassName,List columnList);
22 | public abstract String generateDAO(String doClassName,String queryClassName,String daoClassName,Column primaryKeyColumn);
23 | public abstract String generateDAOImpl(String doClassName,String queryClassName,String daoClassName,String daoImplClassName,Column primaryKeyColumn,String tableName);
24 | public abstract String generateQuery(String queryClassName,List columnQueryList);
25 | public abstract String generateBO(String boClassName,List columnList);
26 | public abstract String generateManager(String objClassName,String queryClassName,String managerClassName,Column primaryKeyColumn);
27 | public abstract String generateManagerImpl(String doClassName,String boClassName,String queryClassName,String transferClassName,String daoClassName,String managerClassName,String managerImplClassName,Column primaryKeyColumn);
28 | public abstract String generateTransfer(String doClassName,String boClassName,String transferClassName,List columnList);
29 | public abstract String generateSqlmap(String tableName, Column primaryKeyColumn, String doClassName, String daoClassName, List columnList, List columnQueryList);
30 | public abstract String generateBaseDAO();
31 | public abstract String generateBaseQuery();
32 | public abstract String generateDAOXml(String daoClassName, String daoImplClassName);
33 | public abstract String generateSQLMapConfigXml(String tableName);
34 | public abstract String generatePersistenceXml(String tableName);
35 |
36 | public static void writeToFile(File file,String fileContent){
37 | try {
38 | FileUtil.writeToFile(file, fileContent);
39 | } catch (IOException e) {
40 | e.printStackTrace();
41 | }
42 | }
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/DAOXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.17 22:53
6 | */
7 | public interface DAOXmlGenerator {
8 | public String generate(String daoClassName,String daoImplClassName);
9 | }
10 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/DaoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:29
8 | */
9 | public interface DaoGenerator {
10 | public String generate(String doClassName, String queryClassName, String daoClassName, Column primaryKeyColumn);
11 | }
12 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/DaoImplGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:31
8 | */
9 | public interface DaoImplGenerator {
10 | public String generate(String doClassName, String queryClassName, String daoClassName, String daoImplClassName, Column primaryKeyColumn, String tableName);
11 | }
12 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/DoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 23:59
10 | */
11 | public interface DoGenerator {
12 | public String generate(String className,List columnList);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/ManagerGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:36
8 | */
9 | public interface ManagerGenerator {
10 | public String generate(String objClassName, String queryClassName, String managerClassName, Column primaryKeyColumn);
11 | }
12 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/ManagerImplGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 1:37
10 | */
11 | public interface ManagerImplGenerator {
12 | public String generate(String doClassName, String boClassName, String queryClassName, String transferClassName, String daoClassName, String managerClassName, String managerImplClassName, Column primaryKeyColumn);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/PersistenceXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.17 22:53
6 | */
7 | public interface PersistenceXmlGenerator {
8 | public String generate(String tableName);
9 | }
10 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/QueryGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 23:59
10 | */
11 | public interface QueryGenerator {
12 | public String generate(String queryClassName, List columnQueryList);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/SQLMapConfigXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | /**
4 | * User: duxing
5 | * Date: 2015.08.17 22:53
6 | */
7 | public interface SQLMapConfigXmlGenerator {
8 | public String generate(String tableName);
9 | }
10 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/SqlmapGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 1:37
10 | */
11 | public interface SqlmapGenerator {
12 | public String generate(String tableName, Column primaryKeyColumn, String doClassName, String daoClassName, List columnList, List columnQueryList);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/TransferGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Column;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015.08.13 1:37
10 | */
11 | public interface TransferGenerator {
12 | public String generate(String doClassName, String boClassName, String transferClassName, List columnList);
13 | }
14 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaBaseDAOGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
6 |
7 | import java.util.Map;
8 |
9 | /**
10 | * User: duxing
11 | * Date: 2015.08.14 23:23
12 | */
13 | public class JavaBaseDAOGenerator extends BaseGenerator {
14 |
15 | @Override
16 | public Code getCode() {
17 | return Code.JAVA;
18 | }
19 |
20 | @Override
21 | public GenerateType generateType() {
22 | return GenerateType.BaseDAO;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaBaseQueryGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
6 |
7 | import java.util.Map;
8 |
9 | /**
10 | * User: duxing
11 | * Date: 2015.08.14 23:24
12 | */
13 | public class JavaBaseQueryGenerator extends BaseGenerator {
14 |
15 | @Override
16 | public Code getCode() {
17 | return Code.JAVA;
18 | }
19 |
20 | @Override
21 | public GenerateType generateType() {
22 | return GenerateType.BaseQuery;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaBoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:32
8 | */
9 | public class JavaBoGenerator extends JavaDoGenerator {
10 |
11 | @Override
12 | public GenerateType generateType() {
13 | return GenerateType.BO;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaDAOXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Setting;
6 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
7 | import cn.fishy.plugin.idea.auto.generator.DAOXmlGenerator;
8 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
9 | import cn.fishy.plugin.idea.auto.util.NameUtil;
10 |
11 | import java.util.Map;
12 |
13 | /**
14 | * User: duxing
15 | * Date: 2015-08-17 00:39
16 | */
17 | public class JavaDAOXmlGenerator extends BaseGenerator implements DAOXmlGenerator {
18 |
19 | @Override
20 | public Code getCode() {
21 | return Code.JAVA;
22 | }
23 |
24 | @Override
25 | public GenerateType generateType() {
26 | return GenerateType.DAOXml;
27 | }
28 |
29 | @Override
30 | public String generate(String daoClassName, String daoImplClassName) {
31 | Map map = initMap();
32 | map.put("daoClassName",daoClassName);
33 | map.put("daoPropertyName", NameUtil.lowFirst(daoClassName));
34 | map.put("daoImplClassName",daoImplClassName);
35 | Setting setting = SettingManager.get();
36 | map.put("encoding", setting.getEncoding());
37 | return generate(map);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaDaoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.domain.Setting;
7 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
8 | import cn.fishy.plugin.idea.auto.generator.DaoGenerator;
9 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
10 | import cn.fishy.plugin.idea.auto.util.NameUtil;
11 | import cn.fishy.plugin.idea.auto.util.PathHolder;
12 |
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | /**
17 | * User: duxing
18 | * Date: 2015.08.13 1:29
19 | */
20 | public class JavaDaoGenerator extends BaseGenerator implements DaoGenerator {
21 | @Override
22 | public String generate(String doClassName, String queryClassName, String daoClassName, Column primaryKeyColumn) {
23 | Map map = initMap();
24 | map.put("objClassName",doClassName);
25 | map.put("objPropertyName", NameUtil.lowFirst(doClassName));
26 | map.put("className", daoClassName);
27 | map.put("queryClassName", queryClassName);
28 | map.put("queryPropertyName", NameUtil.lowFirst(queryClassName));
29 | try{
30 | map.put("primaryKeyName", primaryKeyColumn.getProperty());
31 | map.put("primaryKeyType", primaryKeyColumn.getType());
32 | }catch (Exception e){
33 | map.put("primaryKeyName", "id");
34 | map.put("primaryKeyType", "Long");
35 | }
36 | List importList = getImportList(primaryKeyColumn, false, true);
37 | importList.add(PathHolder.impt(GenerateType.DO,doClassName));
38 | importList.add(PathHolder.impt(GenerateType.Query,queryClassName));
39 | // importList.add(PathHolder.impt(GenerateType.BaseDAO, GenerateType.BaseDAO.getName()));
40 | map.put("importList", importList);
41 | Setting setting = SettingManager.get();
42 | map.put("daoLogicDelete", setting.isDaoLogicDelete());
43 | return super.generate(map);
44 | }
45 |
46 | @Override
47 | public Code getCode() {
48 | return Code.JAVA;
49 | }
50 |
51 | @Override
52 | public GenerateType generateType() {
53 | return GenerateType.DAO;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaDaoImplGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.domain.Setting;
7 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
8 | import cn.fishy.plugin.idea.auto.generator.DaoImplGenerator;
9 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
10 | import cn.fishy.plugin.idea.auto.util.NameUtil;
11 | import cn.fishy.plugin.idea.auto.util.PathHolder;
12 |
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | /**
17 | * User: duxing
18 | * Date: 2015.08.13 1:31
19 | */
20 | public class JavaDaoImplGenerator extends BaseGenerator implements DaoImplGenerator {
21 | @Override
22 | public String generate(String doClassName, String queryClassName, String daoClassName, String daoImplClassName, Column primaryKeyColumn, String tableName) {
23 | Map map = initMap();
24 | map.put("className",daoImplClassName);
25 | map.put("doClassName",doClassName);
26 | map.put("queryClassName", queryClassName);
27 | map.put("daoClassName", daoClassName);
28 | map.put("daoImplClassName", daoImplClassName);
29 | map.put("doPropertyName", NameUtil.lowFirst(doClassName));
30 | map.put("queryPropertyName", NameUtil.lowFirst(queryClassName));
31 | // map.put("primaryKeyColumn", primaryKeyColumn);
32 | try{
33 | map.put("primaryKeyName", primaryKeyColumn.getProperty());
34 | map.put("primaryKeyNameAtMethod", NameUtil.upFirst(primaryKeyColumn.getProperty()));
35 | map.put("primaryKeyType", primaryKeyColumn.getType());
36 | }catch (Exception e){
37 | map.put("primaryKeyName", "id");
38 | map.put("primaryKeyType", "Long");
39 | }
40 | map.put("tableName", tableName);
41 | List importList = getImportList(primaryKeyColumn, false, true);
42 | importList.add(PathHolder.impt(GenerateType.DO, doClassName));
43 | importList.add(PathHolder.impt(GenerateType.DAO, daoClassName));
44 | importList.add(PathHolder.impt(GenerateType.Query, queryClassName));
45 | importList.add(PathHolder.impt(GenerateType.BaseDAO, GenerateType.BaseDAO.getName()));
46 | map.put("importList", importList);
47 | Setting setting = SettingManager.get();
48 | map.put("daoUseSequence", setting.isDaoUseSequence());
49 | map.put("daoLogicDelete", setting.isDaoLogicDelete());
50 | return generate(map);
51 | }
52 |
53 | @Override
54 | public Code getCode() {
55 | return Code.JAVA;
56 | }
57 |
58 | @Override
59 | public GenerateType generateType() {
60 | return GenerateType.DAOImpl;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaDoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.domain.Setting;
7 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
8 | import cn.fishy.plugin.idea.auto.generator.DoGenerator;
9 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
10 | import cn.fishy.plugin.idea.auto.util.PathHolder;
11 |
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 | /**
16 | * User: duxing
17 | * Date: 2015.08.13 1:02
18 | */
19 | public class JavaDoGenerator extends BaseGenerator implements DoGenerator {
20 |
21 | public String generate(String className, List columnList) {
22 | Map map = initMap();
23 | map.put("className",className);
24 | map.put("columnList", columnList);
25 | List importList = getImportList(columnList, true);
26 | if(generateType().equals(GenerateType.Query)){
27 | Setting setting = SettingManager.get();
28 | map.put("pagerQuery",setting.isPagerQuery());
29 | importList.add(PathHolder.impt(GenerateType.BaseQuery, GenerateType.BaseQuery.getName()));
30 | }else{
31 | map.put("pagerQuery",false);
32 | }
33 | map.put("importList", importList);
34 | return super.generate(map);
35 | }
36 |
37 | @Override
38 | public Code getCode() {
39 | return Code.JAVA;
40 | }
41 |
42 | @Override
43 | public GenerateType generateType() {
44 | return GenerateType.DO;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaManagerGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.domain.Setting;
7 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
8 | import cn.fishy.plugin.idea.auto.generator.ManagerGenerator;
9 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
10 | import cn.fishy.plugin.idea.auto.util.NameUtil;
11 | import cn.fishy.plugin.idea.auto.util.PathHolder;
12 |
13 | import java.util.List;
14 | import java.util.Map;
15 |
16 | /**
17 | * User: duxing
18 | * Date: 2015.08.13 1:35
19 | */
20 | public class JavaManagerGenerator extends BaseGenerator implements ManagerGenerator {
21 | @Override
22 | public String generate(String objClassName, String queryClassName, String managerClassName, Column primaryKeyColumn) {
23 | Setting setting = SettingManager.get();
24 | List importList = getImportList(primaryKeyColumn, false, true);
25 | importList.add(PathHolder.impt(GenerateType.Query, queryClassName));
26 | if(setting.isManagerUseBO()) {
27 | importList.add(PathHolder.impt(GenerateType.BO, objClassName));
28 | }else{
29 | importList.add(PathHolder.impt(GenerateType.DO, objClassName));
30 | }
31 | Map map = initMap();
32 | map.put("className", managerClassName);
33 | map.put("objClassName", objClassName);
34 | map.put("objPropertyName", NameUtil.lowFirst(objClassName));
35 | map.put("queryClassName", queryClassName);
36 | map.put("queryPropertyName", NameUtil.lowFirst(queryClassName));
37 | // map.put("primaryKeyColumn", primaryKeyColumn);
38 | try{
39 | map.put("primaryKeyName", primaryKeyColumn.getProperty());
40 | map.put("primaryKeyType", primaryKeyColumn.getType());
41 | }catch (Exception e){
42 | map.put("primaryKeyName", "id");
43 | map.put("primaryKeyType", "Long");
44 | }
45 | map.put("importList", importList);
46 | return generate(map);
47 | }
48 |
49 | @Override
50 | public Code getCode() {
51 | return Code.JAVA;
52 | }
53 |
54 | @Override
55 | public GenerateType generateType() {
56 | return GenerateType.Manager;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaPersistenceXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Setting;
6 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
7 | import cn.fishy.plugin.idea.auto.generator.PersistenceXmlGenerator;
8 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
9 | import cn.fishy.plugin.idea.auto.util.NameUtil;
10 |
11 | import java.util.Map;
12 |
13 | /**
14 | * User: duxing
15 | * Date: 2015-08-17 00:39
16 | */
17 | public class JavaPersistenceXmlGenerator extends BaseGenerator implements PersistenceXmlGenerator {
18 |
19 | @Override
20 | public Code getCode() {
21 | return Code.JAVA;
22 | }
23 |
24 | @Override
25 | public GenerateType generateType() {
26 | return GenerateType.PersistenceXml;
27 | }
28 |
29 | @Override
30 | public String generate(String tableName) {
31 | Map map = initMap();
32 | map.put("tableName",tableName);
33 | map.put("tablePropertyName", NameUtil.propertyName(tableName));
34 | Setting setting = SettingManager.get();
35 | map.put("encoding", setting.getEncoding());
36 | return generate(map);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaQueryGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:32
8 | */
9 | public class JavaQueryGenerator extends JavaDoGenerator {
10 | @Override
11 | public GenerateType generateType() {
12 | return GenerateType.Query;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaSQLMapConfigXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Setting;
6 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
7 | import cn.fishy.plugin.idea.auto.generator.SQLMapConfigXmlGenerator;
8 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
9 |
10 | import java.util.Map;
11 |
12 | /**
13 | * User: duxing
14 | * Date: 2015-08-17 00:39
15 | */
16 | public class JavaSQLMapConfigXmlGenerator extends BaseGenerator implements SQLMapConfigXmlGenerator {
17 | @Override
18 | public Code getCode() {
19 | return Code.JAVA;
20 | }
21 |
22 | @Override
23 | public GenerateType generateType() {
24 | return GenerateType.SQLMapConfigXml;
25 | }
26 |
27 | @Override
28 | public String generate(String tableName) {
29 | Map map = initMap();
30 | map.put("tableName",tableName);
31 | Setting setting = SettingManager.get();
32 | map.put("encoding", setting.getEncoding());
33 | return generate(map);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaSqlmapGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.domain.Setting;
7 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
8 | import cn.fishy.plugin.idea.auto.generator.SqlmapGenerator;
9 | import cn.fishy.plugin.idea.auto.storage.Env;
10 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
11 |
12 | import java.util.List;
13 | import java.util.Map;
14 |
15 | /**
16 | * User: duxing
17 | * Date: 2015.08.13 1:34
18 | */
19 | public class JavaSqlmapGenerator extends BaseGenerator implements SqlmapGenerator {
20 |
21 | @Override
22 | public String generate(String tableName, Column primaryKeyColumn, String doClassName, String daoClassName, List columnList, List columnQueryList) {
23 | Map map = initMap();
24 | map.put("tableName",tableName);
25 | map.put("primaryKeyColumn",primaryKeyColumn);
26 | map.put("doClassName",doClassName);
27 | map.put("daoClassName",daoClassName);
28 | map.put("haveGmtModified",haveKey(columnList, "GMT_MODIFIED"));
29 | map.put("haveIsDeleted",haveKey(columnList,"IS_DELETED"));
30 | map.put("haveDeleted",haveKey(columnList, "DELETED"));
31 | map.put("deleteKey",deleteKey(columnList));
32 | map.put("columnList",columnList);
33 | map.put("columnQueryList", columnQueryList);
34 | map.put("encoding", Env.encodeTo.name());
35 | Setting setting = SettingManager.get();
36 | map.put("daoLogDelete", setting.isDaoLogicDelete());
37 | map.put("daoUseSequence", setting.isDaoUseSequence());
38 | map.put("pagerQuery", setting.isPagerQuery());
39 | return generate(map);
40 | }
41 |
42 | private boolean haveKey(List columnList,String name) {
43 | if(columnList!=null && columnList.size()>0) {
44 | for (Column c : columnList) {
45 | if(c.getName().equals(name)){
46 | return true;
47 | }
48 | }
49 | }
50 | return false;
51 | }
52 |
53 | private String deleteKey(List columnList) {
54 | if(columnList!=null && columnList.size()>0) {
55 | for (Column c : columnList) {
56 | if(deleteKeyList.contains(c.getName())){
57 | return c.getName();
58 | }
59 | }
60 | }
61 | return "{DELETE_KEY}";
62 | }
63 |
64 | @Override
65 | public Code getCode() {
66 | return Code.JAVA;
67 | }
68 |
69 | @Override
70 | public GenerateType generateType() {
71 | return GenerateType.SQLMap;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/java/JavaTransferGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.java;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import cn.fishy.plugin.idea.auto.domain.Code;
5 | import cn.fishy.plugin.idea.auto.domain.Column;
6 | import cn.fishy.plugin.idea.auto.generator.BaseGenerator;
7 | import cn.fishy.plugin.idea.auto.generator.TransferGenerator;
8 | import cn.fishy.plugin.idea.auto.util.PathHolder;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 | import java.util.Map;
13 |
14 | /**
15 | * User: duxing
16 | * Date: 2015.08.13 1:35
17 | */
18 | public class JavaTransferGenerator extends BaseGenerator implements TransferGenerator {
19 | @Override
20 | public String generate(String doClassName, String boClassName, String transferClassName, List columnList) {
21 | Map map = initMap();
22 | map.put("doClassName",doClassName);
23 | map.put("boClassName", boClassName);
24 | map.put("transferClassName", transferClassName);
25 | map.put("columnList", columnList);
26 | List importList = getImportList(new ArrayList(), false, true);
27 | importList.add(PathHolder.impt(GenerateType.DO, doClassName));
28 | importList.add(PathHolder.impt(GenerateType.BO, boClassName));
29 | map.put("importList", importList);
30 | return generate(map);
31 | }
32 |
33 | @Override
34 | public Code getCode() {
35 | return Code.JAVA;
36 | }
37 |
38 | @Override
39 | public GenerateType generateType() {
40 | return GenerateType.Transfer;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseDAOGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaBaseDAOGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.14 23:25
9 | */
10 | public class ScalaBaseDAOGenerator extends JavaBaseDAOGenerator {
11 |
12 | @Override
13 | public Code getCode() {
14 | return Code.SCALA;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaBaseQueryGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaBaseQueryGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.14 23:25
9 | */
10 | public class ScalaBaseQueryGenerator extends JavaBaseQueryGenerator {
11 | @Override
12 | public Code getCode() {
13 | return Code.SCALA;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaBoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:32
8 | */
9 | public class ScalaBoGenerator extends ScalaDoGenerator{
10 | @Override
11 | public GenerateType generateType() {
12 | return GenerateType.BO;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaDAOXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaDAOXmlGenerator;
5 |
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015-08-17 00:37
10 | */
11 | public class ScalaDAOXmlGenerator extends JavaDAOXmlGenerator {
12 |
13 | @Override
14 | public Code getCode() {
15 | return Code.SCALA;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaDaoGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:29
9 | */
10 | public class ScalaDaoGenerator extends JavaDaoGenerator {
11 |
12 | @Override
13 | public Code getCode() {
14 | return Code.SCALA;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaDaoImplGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaDaoImplGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:31
9 | */
10 | public class ScalaDaoImplGenerator extends JavaDaoImplGenerator {
11 |
12 | @Override
13 | public Code getCode() {
14 | return Code.SCALA;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaDoGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaDoGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:02
9 | */
10 | public class ScalaDoGenerator extends JavaDoGenerator {
11 | @Override
12 | public Code getCode() {
13 | return Code.SCALA;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaManagerGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:35
9 | */
10 | public class ScalaManagerGenerator extends JavaManagerGenerator {
11 |
12 | @Override
13 | public Code getCode() {
14 | return Code.SCALA;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaManagerImplGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaManagerImplGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:35
9 | */
10 | public class ScalaManagerImplGenerator extends JavaManagerImplGenerator {
11 | @Override
12 | public Code getCode() {
13 | return Code.SCALA;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaPersistenceXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaPersistenceXmlGenerator;
5 |
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015-08-17 00:38
10 | */
11 | public class ScalaPersistenceXmlGenerator extends JavaPersistenceXmlGenerator {
12 |
13 | @Override
14 | public Code getCode() {
15 | return Code.SCALA;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaQueryGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 1:32
8 | */
9 | public class ScalaQueryGenerator extends ScalaDoGenerator{
10 | @Override
11 | public GenerateType generateType() {
12 | return GenerateType.Query;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaSQLMapConfigXmlGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaSQLMapConfigXmlGenerator;
5 |
6 |
7 | /**
8 | * User: duxing
9 | * Date: 2015-08-17 00:38
10 | */
11 | public class ScalaSQLMapConfigXmlGenerator extends JavaSQLMapConfigXmlGenerator {
12 | @Override
13 | public Code getCode() {
14 | return Code.SCALA;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaSqlmapGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaSqlmapGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:34
9 | */
10 | public class ScalaSqlmapGenerator extends JavaSqlmapGenerator {
11 | @Override
12 | public Code getCode() {
13 | return Code.SCALA;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/generator/scala/ScalaTransferGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.generator.scala;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Code;
4 | import cn.fishy.plugin.idea.auto.generator.java.JavaTransferGenerator;
5 |
6 | /**
7 | * User: duxing
8 | * Date: 2015.08.13 1:35
9 | */
10 | public class ScalaTransferGenerator extends JavaTransferGenerator {
11 | @Override
12 | public Code getCode() {
13 | return Code.SCALA;
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/storage/Env.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.storage;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Encoding;
4 | import com.intellij.openapi.project.Project;
5 | import com.intellij.openapi.vfs.CharsetToolkit;
6 | import com.intellij.openapi.vfs.encoding.EncodingManager;
7 | import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | import java.nio.charset.Charset;
11 |
12 | /**
13 | * User: duxing
14 | * Date: 2015-08-15 14:49
15 | */
16 | public class Env {
17 | public static String sp = System.getProperty("file.separator");
18 | public static Project project;
19 |
20 | public static Charset encodeTo = Charset.forName(Encoding.UTF8.getName());
21 | public static Charset encodeFrom = Charset.forName(Encoding.UTF8.getName());
22 |
23 | @NotNull
24 | public static Charset getProjectCharset() {
25 | try {
26 | return EncodingProjectManager.getInstance(project).getDefaultCharset();
27 | }catch (Exception e){
28 | try{
29 | return Env.project.getBaseDir().getCharset();
30 | }catch (Exception e1){
31 | return Charset.forName("UTF-8");
32 | }
33 | }
34 | }
35 |
36 | @NotNull
37 | public static Charset getIDECharset() {
38 | Charset ideCharset;
39 | try {
40 | ideCharset = EncodingManager.getInstance().getDefaultCharset();
41 | }catch (Exception e){
42 | try {
43 | ideCharset = CharsetToolkit.getDefaultSystemCharset();
44 | }catch (Exception e1){
45 | ideCharset = Charset.forName("UTF-8");
46 | }
47 | }
48 | return ideCharset;
49 | }
50 |
51 | @NotNull
52 | public static Charset getCharsetFromEncoding(String encoding) {
53 | try {
54 | return Charset.forName(encoding);
55 | }catch (Exception e){
56 | return Charset.defaultCharset();
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/storage/PluginConfigHolder.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.storage;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.domain.PluginConfig;
4 | import com.intellij.openapi.components.PersistentStateComponent;
5 | import com.intellij.openapi.components.ServiceManager;
6 | import com.intellij.openapi.components.Storage;
7 | import com.intellij.openapi.components.StoragePathMacros;
8 | import com.intellij.openapi.components.StorageScheme;
9 | import com.intellij.util.xmlb.XmlSerializerUtil;
10 | import org.jetbrains.annotations.Nullable;
11 |
12 | /**
13 | * User: duxing
14 | * Date: 2015.8.11
15 | */
16 |
17 | @com.intellij.openapi.components.State(
18 | name = "PluginConfig",
19 | storages = {
20 | @Storage(
21 | file = StoragePathMacros.APP_CONFIG + "/autoGenerator.xml"
22 | )}
23 | )
24 | public class PluginConfigHolder implements PersistentStateComponent {
25 | public PluginConfig pluginConfig = new PluginConfig();
26 | @Nullable
27 | @Override
28 | public PluginConfig getState() {
29 | return pluginConfig;
30 | }
31 |
32 | @Override
33 | public void loadState(PluginConfig state) {
34 | XmlSerializerUtil.copyBean(state, pluginConfig);
35 | }
36 |
37 | @Nullable
38 | public static PluginConfig getPluginConfig() {
39 | try {
40 | return ServiceManager.getService(PluginConfigHolder.class).getState();
41 | }catch (Exception e){
42 | return null;
43 | }
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/storage/PluginProjectConfigHolder.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.storage;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.domain.PluginProjectConfig;
4 | import com.intellij.openapi.components.PersistentStateComponent;
5 | import com.intellij.openapi.components.ServiceManager;
6 | import com.intellij.openapi.components.Storage;
7 | import com.intellij.openapi.components.StoragePathMacros;
8 | import com.intellij.openapi.components.StorageScheme;
9 | import com.intellij.util.xmlb.XmlSerializerUtil;
10 | import org.jetbrains.annotations.Nullable;
11 |
12 | /**
13 | * User: duxing
14 | * Date: 2015.8.11
15 | */
16 |
17 | @com.intellij.openapi.components.State(
18 | name = "PluginProjectConfig",
19 | storages = {
20 | @Storage(id = "default", file = StoragePathMacros.PROJECT_FILE),
21 | @Storage(id = "dir", file = StoragePathMacros.PROJECT_CONFIG_DIR + "/autoProjectGenerator.xml", scheme = StorageScheme.DIRECTORY_BASED)
22 | }
23 | )
24 | public class PluginProjectConfigHolder implements PersistentStateComponent {
25 | public PluginProjectConfig pluginProjectConfig = new PluginProjectConfig();
26 |
27 | @Nullable
28 | @Override
29 | public PluginProjectConfig getState() {
30 | return pluginProjectConfig;
31 | }
32 |
33 | @Override
34 | public void loadState(PluginProjectConfig state) {
35 | XmlSerializerUtil.copyBean(state, pluginProjectConfig);
36 | }
37 |
38 | @Nullable
39 | public static PluginProjectConfig getPluginProjectConfig() {
40 | if(Env.project==null)return null;
41 | try {
42 | return ServiceManager.getService(Env.project, PluginProjectConfigHolder.class).getState();
43 | }catch (Exception e){
44 | return null;
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/storage/domain/PluginConfig.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.storage.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.8.11
8 | */
9 |
10 | public class PluginConfig implements Serializable {
11 | private static final long serialVersionUID = -2408231700721356773L;
12 |
13 | public String author = "duxing //change at Setting Tab";
14 | public String language = "english";
15 | public String code = "JAVA";
16 | public String encoding = "UTF-8";
17 |
18 | //扩展模板管理内容
19 | /**
20 | * 是否使用自定义的模板
21 | */
22 | public Boolean tplUseCustom = false;
23 | /**
24 | * 模板自定义目录
25 | */
26 | public String tplPathCustom = "";
27 | }
28 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/storage/domain/PluginProjectConfig.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.storage.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2014.9.17
8 | */
9 |
10 | public class PluginProjectConfig implements Serializable {
11 | private static final long serialVersionUID = -4385855355672890609L;
12 |
13 | public String code = "JAVA";
14 | public String encoding = "UTF-8";
15 | public String path;
16 | public boolean daoLogicDelete = true;
17 | public boolean managerUseBO = true;
18 | public boolean daoUseSequence = true;
19 | public boolean pagerQuery = true;
20 | public boolean overwrite = false;
21 | public Boolean generateBase = false;
22 | public String sql = "INPUT SQL HERE JUST LIKE BELOW \n\n ================================================ \n\nCREATE TABLE `app_model` ( `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id for number', `app` varchar(20) NOT NULL COMMENT 'application name', `model` varchar(20) NOT NULL COMMENT 'application model', PRIMARY KEY (`id`), KEY `app` (`app`,`model`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='application model table' AUTO_INCREMENT=2;\n" +
23 | "\n" +
24 | " ================================================ \n" +
25 | "\n";
26 | }
27 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/FileEncoder.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.Env;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 23:32
8 | */
9 | public class FileEncoder{
10 |
11 | public static byte[] getBytes(String content){
12 | return content.getBytes(Env.encodeFrom);
13 | }
14 |
15 | public static String encode(String content){
16 | byte[] bytes = getBytes(content);
17 | return new String(bytes,Env.encodeTo);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/FileOpener.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import cn.fishy.plugin.idea.auto.storage.Env;
4 | import com.intellij.openapi.fileEditor.FileEditorManager;
5 | import com.intellij.openapi.vfs.LocalFileSystem;
6 | import com.intellij.openapi.vfs.VirtualFile;
7 | import com.intellij.openapi.vfs.VirtualFileManager;
8 |
9 | import java.io.File;
10 |
11 | /**
12 | * User: duxing
13 | * Date: 2015.08.17 23:25
14 | */
15 | public class FileOpener {
16 | public static void openFile(File f){
17 | try {
18 | VirtualFileManager.getInstance().syncRefresh();
19 | VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(f);
20 | if(vf!=null){
21 | FileEditorManager.getInstance(Env.project).openFile(vf, false);
22 | }
23 | }catch (Exception e){
24 | e.printStackTrace();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/FileWriter.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import cn.fishy.plugin.idea.auto.domain.Setting;
4 | import cn.fishy.plugin.idea.auto.storage.SettingManager;
5 | import com.intellij.openapi.util.io.FileUtil;
6 | import com.intellij.psi.PsiFile;
7 |
8 | import java.io.File;
9 | import java.io.IOException;
10 |
11 | /**
12 | * User: duxing
13 | * Date: 2015.08.13 23:53
14 | */
15 | public class FileWriter {
16 | private static String msg;
17 | public static boolean write(String filePath, String fileNameWithExt, byte[] contentByte){
18 | File p = new File(filePath);
19 | p.mkdirs();
20 | File f = new File(filePath+fileNameWithExt);
21 | Setting setting = SettingManager.get();
22 | boolean r = false;
23 | if(!f.exists()|| setting.overwrite){
24 | try {
25 | if(contentByte!=null && contentByte.length>0) {
26 | FileUtil.writeToFile(f, contentByte);
27 | r = true;
28 | }else{
29 | setMsg("content empty");
30 | }
31 | } catch (IOException e) {
32 | setMsg("exception: "+e.getCause());
33 | }
34 | }else{
35 | setMsg("file exist");
36 | }
37 | FileOpener.openFile(f);
38 | return r;
39 | }
40 |
41 | public static String getMsg() {
42 | return msg;
43 | }
44 |
45 | public static void setMsg(String msg) {
46 | FileWriter.msg = msg;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/Matcher.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import org.apache.commons.lang.StringUtils;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 | import java.util.Map;
8 | import java.util.regex.Pattern;
9 |
10 | /**
11 | * 内容匹配类
12 | * User: duxing
13 | * Date: 2015.07.26 23:38
14 | */
15 | public class Matcher {
16 |
17 | public static List match(String regString, int index, String content){
18 | List r = new ArrayList();
19 | java.util.regex.Matcher mr = Pattern.compile(regString,Pattern.DOTALL+Pattern.CASE_INSENSITIVE).matcher(content);
20 | while (mr.find()) {
21 | r.add(mr.group(index));
22 | }
23 | return r;
24 | }
25 |
26 | public static List match(String regString, String content){
27 | List r = new ArrayList();
28 | java.util.regex.Matcher mr = Pattern.compile(regString,Pattern.CASE_INSENSITIVE + Pattern.DOTALL).matcher(content);
29 | outer: while (mr.find()) {
30 | inner : for(int i=0;i filterRegList, String content) {
47 | if(filterRegList!=null && filterRegList.size()>0) {
48 | for (String filter : filterRegList) {
49 | java.util.regex.Matcher mr = Pattern.compile(filter).matcher(content);
50 | content = mr.replaceAll("");
51 | }
52 | }
53 | return content;
54 | }
55 |
56 | public static String getMain(String mainReg, String content) {
57 | if(StringUtils.isNotBlank(mainReg)) {
58 | java.util.regex.Matcher mr = Pattern.compile(mainReg).matcher(content);
59 | content = mr.group();
60 | }
61 | return content;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/NameUtil.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import cn.fishy.plugin.idea.auto.constant.GenerateType;
4 | import org.apache.commons.lang.StringUtils;
5 |
6 | /**
7 | * 名称工具类
8 | * User: duxing
9 | * Date: 2015.08.13 23:17
10 | */
11 | public class NameUtil {
12 | public static String toWords(String name) {
13 | return name.replaceAll("_", " ");
14 | }
15 |
16 | public static String formatName(String name) {
17 | return upFirstAll(toWords(name.toLowerCase())).replaceAll(" ", "");
18 | }
19 |
20 | public static String upFirstAll(String s) {
21 | s = s.trim().replaceAll("\\s", " ");
22 | String[] sa = s.split(" ");
23 | String r = "";
24 | for (String o : sa) {
25 | if (StringUtils.isNotBlank(o)) {
26 | r += upFirst(o);
27 | }
28 | }
29 | return r;
30 | }
31 |
32 | public static String upFirst(String o) {
33 | return o.replaceFirst(o.substring(0, 1), o.substring(0, 1).toUpperCase());
34 | }
35 |
36 | public static String lowFirst(String o) {
37 | return o.replaceFirst(o.substring(0, 1), o.substring(0, 1).toLowerCase());
38 | }
39 |
40 | public static String propertyName(String s) {
41 | return lowFirst(formatName(s));
42 | }
43 |
44 | public static String name(String s, GenerateType generateType){
45 | if(generateType.equals(GenerateType.SQLMap)){
46 | return s.toLowerCase()+generateType.getSuffix();
47 | }else if(generateType.equals(GenerateType.BaseDAO) || generateType.equals(GenerateType.BaseQuery)){
48 | return generateType.getSuffix();
49 | }else{
50 | return formatName(s) + generateType.getSuffix();
51 | }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/ResourceUtil.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 |
4 | import com.intellij.openapi.diagnostic.Logger;
5 |
6 | import java.io.IOException;
7 | import java.io.InputStream;
8 | import java.io.InputStreamReader;
9 | import java.io.LineNumberReader;
10 | import java.io.UnsupportedEncodingException;
11 |
12 | /**
13 | * User: duxing
14 | * Date: 2016-02-26 21:03
15 | */
16 | public class ResourceUtil {
17 | private static final Logger logger = Logger.getInstance(ResourceUtil.class);
18 |
19 | /**
20 | * 读取utf-8的文本文件
21 | * @param textFilePath 文本类型文件相对于resources的路径
22 | * @return
23 | */
24 | public static String load(String textFilePath){
25 | return load(textFilePath, "utf-8");
26 | }
27 |
28 | /**
29 | * 读取文本文件
30 | * @param textFilePath 文本类型文件相对于resources的路径
31 | * @param charset 字符集 如gbk,utf-8
32 | * @return
33 | */
34 | public static String load(String textFilePath, String charset){
35 | if(textFilePath==null || textFilePath.equals(""))return null;
36 | if(textFilePath.startsWith("/"))textFilePath=textFilePath.substring(1,textFilePath.length());
37 | InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(textFilePath);
38 | return getStringFromInputStream(charset, stream);
39 | }
40 |
41 | /**
42 | * 读取文本文件
43 | * @param textFilePath 文本类型文件相对于resources的路径
44 | * @param charset 字符集 如gbk,utf-8
45 | * @param clz 资源相对类, 如使用此方法的类本身
46 | * @return
47 | */
48 | public static String load(String textFilePath, String charset, Class clz){
49 | if(textFilePath==null || textFilePath.equals(""))return null;
50 | if(!textFilePath.startsWith("/"))textFilePath="/"+textFilePath;
51 | InputStream stream = clz.getResourceAsStream(textFilePath);
52 | return getStringFromInputStream(charset, stream);
53 | }
54 |
55 | private static String getStringFromInputStream(String charset, InputStream stream) {
56 | StringBuilder str = new StringBuilder();
57 | try {
58 | LineNumberReader lineNr = new LineNumberReader(new InputStreamReader(stream,charset));
59 | long i=0;
60 | for (String line = lineNr.readLine(); line != null; line = lineNr.readLine()) {
61 | if(i>0)str.append("\n");
62 | str.append(line);
63 | i++;
64 | }
65 | } catch (UnsupportedEncodingException e) {
66 | logger.error("Encoding error",e);
67 | } catch (IOException e) {
68 | logger.error("IO error",e);
69 | }
70 | return str.toString();
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/src/cn/fishy/plugin/idea/auto/util/TypeChanger.java:
--------------------------------------------------------------------------------
1 | package cn.fishy.plugin.idea.auto.util;
2 |
3 | import java.util.HashMap;
4 |
5 | /**
6 | * User: duxing
7 | * Date: 2015.08.13 23:26
8 | */
9 | public class TypeChanger {
10 |
11 | public static HashMap typeMap = new HashMap();
12 | static {
13 | /**
14 | * mysql
15 | */
16 | typeMap.put("TINYINT", "Integer");
17 | typeMap.put("SMALLINT", "Integer");
18 | typeMap.put("MEDIUMINT", "Integer");
19 | typeMap.put("INT", "Long");
20 | typeMap.put("BIGINT", "Long");
21 | typeMap.put("DECIMAL", "BigDecimal");
22 | typeMap.put("FLOAT", "Float");
23 | typeMap.put("DOUBLE", "Double");
24 | typeMap.put("REAL", "Float");
25 | typeMap.put("BIT", "Boolean");
26 | typeMap.put("BOOLEAN", "Boolean");
27 | typeMap.put("SERIAL", "Long");
28 | typeMap.put("DATE", "Date");
29 | typeMap.put("DATETIME", "Date");
30 | typeMap.put("TIMESTAMP", "Long");
31 | typeMap.put("TIME", "String");
32 | typeMap.put("YEAR", "Integer");
33 | typeMap.put("CHAR", "String");
34 | typeMap.put("VARCHAR", "String");
35 | typeMap.put("TINYTEXT", "String");
36 | typeMap.put("TEXT", "String");
37 | typeMap.put("MEDIUMTEXT", "String");
38 | typeMap.put("LONGTEXT", "String");
39 | typeMap.put("BINARY", "String");
40 | typeMap.put("VARBINARY", "String");
41 | //有待考验,blob里面一般存储字节流
42 | typeMap.put("TINYBLOB", "Object");
43 | typeMap.put("MEDIUMBLOB", "Object");
44 | typeMap.put("BLOB", "Object");
45 | typeMap.put("LONGBLOB", "Object");
46 | typeMap.put("ENUM", "String");
47 | typeMap.put("SET", "String");
48 | /**
49 | * oracle
50 | */
51 | typeMap.put("NUMBER", "Long");
52 | typeMap.put("RAW", "String");
53 | }
54 |
55 | public static String clean(String typeStr){
56 | return typeStr.replaceAll("\\(.*\\)*","").toUpperCase();
57 | }
58 |
59 | public static String getType(String typeStr){
60 | String type = typeMap.get(typeStr);
61 | if(type==null)type="String";
62 | return type;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/sreenshot/Image 1-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 1-2.png
--------------------------------------------------------------------------------
/sreenshot/Image 1-2.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 1-2.psd
--------------------------------------------------------------------------------
/sreenshot/Image 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 1.png
--------------------------------------------------------------------------------
/sreenshot/Image 1.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 1.psd
--------------------------------------------------------------------------------
/sreenshot/Image 12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 12.png
--------------------------------------------------------------------------------
/sreenshot/Image 13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 13.png
--------------------------------------------------------------------------------
/sreenshot/Image 13.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 13.psd
--------------------------------------------------------------------------------
/sreenshot/Image 16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 16.png
--------------------------------------------------------------------------------
/sreenshot/Image 16.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 16.psd
--------------------------------------------------------------------------------
/sreenshot/Image 17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 17.png
--------------------------------------------------------------------------------
/sreenshot/Image 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 2.png
--------------------------------------------------------------------------------
/sreenshot/Image 21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 21.png
--------------------------------------------------------------------------------
/sreenshot/Image 23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 23.png
--------------------------------------------------------------------------------
/sreenshot/Image 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 3.png
--------------------------------------------------------------------------------
/sreenshot/Image 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 4.png
--------------------------------------------------------------------------------
/sreenshot/Image 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image 5.png
--------------------------------------------------------------------------------
/sreenshot/Image-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/i17c/AutoGenerator/8b1f15cf2085aeed2dcf92801483d9a9dcf0dd73/sreenshot/Image-16.png
--------------------------------------------------------------------------------