SSHFrame
页面展示:
hibernate5.2.8_spring4.3.7_struts2.5.1 整合
struts2.5.1
1.实现MVC设计模式
hibernate5.2.8
1.增加通用HQL通用DAO
HqlDao.java
spring4.3.7
1.整合SSH
2.配置数据源
3.配置sessionFactory
4.配置事务管理
<!-- 声明式容器事务管理 ,transaction-manager指定事务管理器为transactionManager -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config expose-proxy="true">
<!-- 只对业务逻辑层实施事务 -->
<aop:pointcut id="txPointcut" expression="execution(* com.czr.frame.util.dao.impl..*.*(..))" />
<!-- Advisor定义,切入点和通知分别为txPointcut、txAdvice -->
<aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice" />
</aop:config>
easy ui 1.5.1
1.主页面布局
2.增加基本增删改查页面
代码生成器
1.github地址:
https://github.com/chenzhirong/CodeGenerator.git
2.配置文件
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<configuration>
<classpath>
<entry>lib/ojdbc14.jar</entry>
</classpath>
<connections>
<database name="czr">
<driverClass>oracle.jdbc.driver.OracleDriver</driverClass>
<url>jdbc:oracle:thin:@localhost:1521:orcl</url>
<username>czr</username>
<password>czr</password>
<schema/>
</database>
</connections>
<targetProject>D:\01_CreateCode</targetProject>
<basePackage>com.czr.frame</basePackage>
<moduleName>zb</moduleName>
<templates>
<template engine="freemarker" name="实体类" selected="true">
<templateFile>/SSHFrame/bean.ftl</templateFile>
<targetPath>${targetProject}\beans\</targetPath>
<targetFileName>${table.className?substring(1)}.java</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="hibernate.hbm.xml" selected="true">
<templateFile>/SSHFrame/hibernate.hdm.ftl</templateFile>
<targetPath>${targetProject}\domain\</targetPath>
<targetFileName>${table.className?substring(1)}.hbm.xml</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="action" selected="true">
<templateFile>/SSHFrame/action.ftl</templateFile>
<targetPath>${targetProject}\action\</targetPath>
<targetFileName>${table.className?substring(1)}Action.java</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="struts" selected="true">
<templateFile>/SSHFrame/struts.ftl</templateFile>
<targetPath>${targetProject}\config\</targetPath>
<targetFileName>${table.className?substring(1)?lower_case}_struts-config.xml</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="spring" selected="true">
<templateFile>/SSHFrame/spring.ftl</templateFile>
<targetPath>${targetProject}\config\</targetPath>
<targetFileName>${table.className?substring(1)?lower_case}_spring-config.xml</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="service" selected="true">
<templateFile>/SSHFrame/service.ftl</templateFile>
<targetPath>${targetProject}\service\</targetPath>
<targetFileName>${table.className?substring(1)}Service.java</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="serviceimpl" selected="true">
<templateFile>/SSHFrame/serviceImpl.ftl</templateFile>
<targetPath>${targetProject}\service\</targetPath>
<targetFileName>${table.className?substring(1)}ServiceImpl.java</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="js" selected="true">
<templateFile>/SSHFrame/js.ftl</templateFile>
<targetPath>${targetProject}\jsp\</targetPath>
<targetFileName>${table.className?substring(1)?lower_case}.js</targetFileName>
<encoding>UTF-8</encoding>
</template>
<template engine="freemarker" name="jsp" selected="true">
<templateFile>/SSHFrame/jsp.ftl</templateFile>
<targetPath>${targetProject}\jsp\</targetPath>
<targetFileName>${table.className?substring(1)?lower_case}.jsp</targetFileName>
<encoding>UTF-8</encoding>
</template>
</templates>
</configuration>