`

配置文件

    博客分类:
  • java
 
阅读更多
MybatisMappingUtils
package com.mycompany.myapp.common.utils;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import java.util.Map;

/**
 * Mybasis映射生成器
 */
public class MybatisMappingUtils {

    private static Map<String,String> typeMap = Maps.newHashMap();

    private static String[] tableNames = {"user","lesson"};

    public MybatisMappingUtils(){
        typeMap.put("int","Integer");
        typeMap.put("bigint","Long");
        typeMap.put("decimal","Double");
        typeMap.put("double","Double");
        typeMap.put("float","Float");
        typeMap.put("varchar","String");
        typeMap.put("char","String");
        typeMap.put("text","String");
        typeMap.put("datetime","Date");
        typeMap.put("date","Date");
        typeMap.put("timestamp","Date");
    }

    public static void main(String[] args) throws Exception {
        new MybatisMappingUtils().mappingGenerator();
    }

    public void mappingGenerator() throws Exception{
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "1234");

        Statement statement = conn.createStatement();

        for(String tableName : tableNames){
            String className = tableNameToClassName(tableName);
            List<PropertyInfo> propertyInfos = Lists.newArrayList();

            ResultSet rs = statement.executeQuery("show full columns from  " + tableName);
            while(rs.next()){
                String columnName = rs.getString("Field");
                String propertyName = columnToProperty(columnName);
                String propertyType = typeMap.get(rs.getString("Type").replaceAll("\\(.*\\)",""));
                String comment = rs.getString("Comment");
                propertyInfos.add(new PropertyInfo(columnName,propertyName,propertyType,comment));
            }

            System.out.println(JSON.toJSONString(propertyInfos));

            beanGenerator(className,propertyInfos);
            sqlmapGenerator(tableName, className,propertyInfos);
        }
    }

    private void sqlmapGenerator(String tableName, String className, List<PropertyInfo> propertyInfos) throws IOException {

        File  file = new File(System.getProperty("user.dir"),"src/main/resources/sqlmap/mapping-" + tableName +".xml");
        FileWriter writer = new FileWriter(file);
        writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
        writer.write("<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n");
        writer.write("<mapper namespace=\"com.mycompany.myapp.dao."+className+"Dao\">\n");
        writer.write(resultMap(className,propertyInfos));
        writer.write(baseColumn(propertyInfos));
        writer.write(queryParams());
        writer.write(orderBy());
        writer.write(insert(tableName,propertyInfos));
        writer.write(batchInsert(tableName,propertyInfos));
        writer.write(update(tableName,propertyInfos));
        writer.write(delete(tableName));
        writer.write(batchDelete(tableName));
        writer.write(getById(tableName));
        writer.write(queryByIds(tableName));
        writer.write(queryList(tableName));
        writer.write(count(tableName));
        writer.write(queryPage(tableName));
        writer.write(updateStatus(tableName));
        writer.write(batchUpdateStatus(tableName));
        writer.write("</mapper>");

        writer.close();
    }

    private void beanGenerator(String className,List<PropertyInfo> propertyInfos) throws IOException {

        File file = new File(System.getProperty("user.dir"),"src/main/java/com/mycompany/myapp/domain/" + className +".java");
        FileWriter writer = new FileWriter(file);
        writer.write("package com.mycompany.myapp.domain;\n");
        writer.write("import com.mycompany.myapp.base.BaseDO;\n");
        writer.write("import java.util.Date;\n");

        writer.write("public class "+className+" extends BaseDO {\n");
        writer.write("\n");
        for(PropertyInfo info : propertyInfos){
            writer.write("private " + info.getType() + " " + info.getProperty()+"; //"+ info.getComment()+" \n");
        }
        for(PropertyInfo info : propertyInfos){
            String type = info.getType();
            String property = info.getProperty();
            writer.write("public " + type + " get" + StringUtils.capitalize(property)+"(){\n");
            writer.write("return " + property +";\n");
            writer.write("}\n");
            writer.write("public void set" + StringUtils.capitalize(property) +"("+ type + " " + property +"){\n");
            writer.write("this." + property + " = " + property +";\n");
            writer.write("}\n");
        }
        writer.write("}\n");
        writer.close();
    }

    private String resultMap(String className, List<PropertyInfo> propertyInfos){

        StringBuffer buff = new StringBuffer();
        buff.append("\t<resultMap id=\"BaseResultMap\" type=\""+className+"\">\n");
        for(PropertyInfo info : propertyInfos){
            String property = info.getProperty();
            String column = info.getColumn();
            if(info.getProperty().equals("id")){
                buff.append("\t\t<id column=\"id\" property=\"id\"/>\n");
            }else{
                buff.append("\t\t<result column=\""+column+"\" property=\""+property+"\"/>\n");
            }
        }
        buff.append("\t</resultMap>\n\n");

        return buff.toString();
    }

    private String baseColumn(List<PropertyInfo> propertyInfos){
        return "\t<sql id=\"baseColumn\">\n" +
                "\t\t" + getBaseColumn(propertyInfos) + "\n" +
                "\t</sql>\n\n";
    }

    private String queryParams() {
        return "\t<sql id=\"queryParams\">\n" +
                "\t</sql>\n\n";

    }

    private String orderBy(){
        return "\t<sql id=\"orderBy\">\n" +
                "\t\torder by gmt_modified desc\n" +
                "\t</sql>\n\n";
    }


    private String insert(String tableName,List<PropertyInfo> propertyInfos){
        return "\t<insert id=\"insert\" useGeneratedKeys=\"true\" keyProperty=\"id\">\n"+
                "\t\tinsert into "+tableName + " ("+ getInsertColumn(propertyInfos)+ ") values\n"+
                "\t\t("+getInsertProperty(propertyInfos)+")\n"+
                "\t</insert>\n\n";
    }

    private String batchInsert(String tableName,List<PropertyInfo> propertyInfos){

        return "\t<insert id=\"batchInsert\">\n" +
                "\t\tinsert into "+tableName + " ("+ getInsertColumn(propertyInfos)+ ") values\n" +
                "\t\t<foreach collection=\"list\" item=\"item\" separator=\",\">\n" +
                "\t\t\t("+getBatchInsertProperty(propertyInfos)+")\n" +
                "\t\t</foreach>\n" +
                "\t</insert>\n\n";
    }

    private String update(String tableName,List<PropertyInfo> propertyInfos) {

        StringBuffer buff = new StringBuffer();
        buff.append("\t<update id=\"update\">\n");
        buff.append("\t\tupdate "+tableName+"\n\t\tset ");
        for (PropertyInfo info : propertyInfos) {
            if (info.getColumn().equals("id")) {
                continue;
            }

            if (info.getColumn().equals("gmt_modified")) {
                buff.append(info.getColumn() + "=now(),");
            } else {
                buff.append(info.getColumn() + "=#{" + info.getProperty() + "},");
            }
        }
        buff = new StringBuffer(buff.substring(0,buff.length()-1));

        buff.append("\n\t\twhere id = #{id}\n");
        buff.append("\t</update>\n\n");

        return buff.toString();
    }

    private String delete(String tableName) {

        return "\t<delete id=\"delete\">\n" +
                "\t\tdelete from " + tableName + " where id = #{id}\n" +
                "\t</delete>\n\n";
    }
    private String batchDelete(String tableName) {

        return "\t<delete id=\"batchDelete\">\n" +
                "\t\tdelete from "+tableName+"\n" +
                "\t\t<where>\n" +
                "\t\t\t<choose>\n" +
                "\t\t\t\t<when test=\"list != null and list.size()>0\">\n" +
                "\t\t\t\t\tid in\n" +
                "\t\t\t\t\t<foreach collection=\"list\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n" +
                "\t\t\t\t\t\t#{id}\n" +
                "\t\t\t\t\t</foreach>\n" +
                "\t\t\t\t</when>\n" +
                "\t\t\t\t<otherwise>\n" +
                "\t\t\t\t\t1=0\n" +
                "\t\t\t\t</otherwise>\n" +
                "\t\t\t</choose>\n" +
                "\t\t</where>\n" +
                "\t</delete>\n\n";
    }
    private String getById(String tableName) {
        return "\t<select id=\"getById\" resultMap=\"BaseResultMap\">\n" +
                "\t\tselect <include refid=\"baseColumn\" /> from "+tableName+"\n"+
                "where id = #{id}\n" +
                "\t</select>\n\n";
    }
    private String queryByIds(String tableName) {
        return "\t<select id=\"queryByIds\" resultMap=\"BaseResultMap\">\n" +
                "\t\tselect <include refid=\"baseColumn\" /> from "+tableName+"\n"+
                "\t\t<where>\n" +
                "\t\t\t<choose>\n" +
                "\t\t\t\t<when test=\"list != null and list.size()>0\">\n" +
                "\t\t\t\t\tid in\n" +
                "\t\t\t\t\t<foreach collection=\"list\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n" +
                "\t\t\t\t\t\t#{id}\n" +
                "\t\t\t\t\t</foreach>\n" +
                "\t\t\t\t</when>\n" +
                "\t\t\t\t<otherwise>\n" +
                "\t\t\t\t\t1=0\n" +
                "\t\t\t\t</otherwise>\n" +
                "\t\t\t</choose>\n" +
                "\t\t</where>\n" +
                "\t</select>\n\n";
    }
    private String queryList(String tableName) {
        return "<select id=\"queryList\" resultMap=\"BaseResultMap\">\n" +
                "\t\tselect <include refid=\"baseColumn\" /> from "+tableName+"\n"+
                "\t\t<include refid=\"queryParams\" />\n" +
                "\t\t<include refid=\"orderBy\"/>\n" +
                "\t</select>\n\n";
    }

    private String count(String tableName) {
        return "\t<select id=\"count\" resultType=\"int\">\n" +
                "\t\tselect count(1) from "+tableName+"\n" +
                "\t\t<include refid=\"queryParams\" />\n" +
                "\t</select>\n\n";
    }
    private String queryPage(String tableName) {
        return "\t<select id=\"queryPage\" resultMap=\"BaseResultMap\">\n" +
                "\t\tselect <include refid=\"baseColumn\" /> from "+tableName+"\n"+
                "\t\t<include refid=\"queryParams\" />\n" +
                "\t</select>\n\n";
    }
    private String updateStatus(String tableName) {
        return "\t<update id=\"updateStatus\">\n" +
                "\t\tupdate "+tableName+" set status=#{status}\n"+
                "\t\twhere id=#{id}\n" +
                "\t</update>\n\n";
    }
    private String batchUpdateStatus(String tableName) {
        return "\t<update id=\"batchUpdateStatus\">\n" +
                "\t\tupdate "+tableName+" set status=#{status}\n" +
                "\t\t<where>\n" +
                "\t\t\t<choose>\n" +
                "\t\t\t\t<when test=\"list != null and list.size()>0\">\n" +
                "\t\t\t\t\tid in\n" +
                "\t\t\t\t\t<foreach collection=\"list\" item=\"id\" separator=\",\" open=\"(\" close=\")\">\n" +
                "\t\t\t\t\t\t#{id}\n" +
                "\t\t\t\t\t</foreach>\n" +
                "\t\t\t\t</when>\n" +
                "\t\t\t\t<otherwise>\n" +
                "\t\t\t\t\t1=0\n" +
                "\t\t\t\t</otherwise>\n" +
                "\t\t\t</choose>\n" +
                "\t\t</where>\n" +
                "\t</update>\n\n";
    }


    private String getInsertColumn(List<PropertyInfo> propertyInfos) {

        StringBuffer insertColumn = new StringBuffer();
        for(PropertyInfo info : propertyInfos){
            if(!info.getColumn().equals("id")){
                insertColumn.append(info.getColumn()).append(",");
            }
        }

        return insertColumn.substring(0,insertColumn.length()-1);
    }

    private String getInsertProperty(List<PropertyInfo> propertyInfos){
        StringBuffer batchInsertProperty = new StringBuffer();
        for(PropertyInfo info : propertyInfos){
            if(info.getColumn().equals("gmt_modified") || info.getColumn().equals("gmt_create")){
                batchInsertProperty.append("now(),");
                continue;
            }

            if(!info.getColumn().equals("id")){
                batchInsertProperty.append("#{").append(info.getColumn()).append("},");
            }
        }
        return batchInsertProperty.substring(0,batchInsertProperty.length()-1);
    }

    private String getBatchInsertProperty(List<PropertyInfo> propertyInfos){
        StringBuffer batchInsertProperty = new StringBuffer();
        for(PropertyInfo info : propertyInfos){
            if(info.getColumn().equals("gmt_modified") || info.getColumn().equals("gmt_create")){
                batchInsertProperty.append("now(),");
                continue;
            }

            if(!info.getColumn().equals("id")){
                batchInsertProperty.append("#{item.").append(info.getColumn()).append("},");
            }
        }
        return batchInsertProperty.substring(0,batchInsertProperty.length()-1);
    }


    private String getBaseColumn(List<PropertyInfo> propertyInfos) {

        StringBuffer baseColumn = new StringBuffer();
        for(PropertyInfo info : propertyInfos){
                baseColumn.append(info.getColumn()).append(",");
        }

        return baseColumn.substring(0,baseColumn.length()-1);
    }

    public  String columnToProperty(String column){

        StringBuffer buff = new StringBuffer();
       for(String s : StringUtils.split(column,"_")){
            if(buff.length() == 0){
                buff.append(s);
            }else{
                buff.append(StringUtils.capitalize(s));
            }
       }

        return buff.toString();
    }

    public String tableNameToClassName(String tableName){

        StringBuffer buff = new StringBuffer();
        for(String s : StringUtils.split(tableName,"_")){
            buff.append(StringUtils.capitalize(s));
        }

        return buff.toString();
    }


    private class PropertyInfo{
        private String column;
        private String property;
        private String type;
        private String comment;

        public PropertyInfo(String column, String property, String type,String comment) {
            this.column = column;
            this.property = property;
            this.type = type;
            this.comment = comment;
        }

        public String getColumn() {
            return column;
        }

        public void setColumn(String column) {
            this.column = column;
        }

        public String getProperty() {
            return property;
        }

        public void setProperty(String property) {
            this.property = property;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }
    }
}
 
logbak.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
	    <target>System.out</target>
		<encoder>
			<pattern><![CDATA[
%n%-4r [%d{yyyy-MM-dd HH:mm:ss}] %X{productionMode} - %X{method} %X{requestURIWithQueryString}[%file:%line][%method] [ip=%X{remoteAddr}, ref=%X{referrer}, ua=%X{userAgent}, sid=%X{cookie.JSESSIONID}]%n  %-5level %logger{35} - %m%n
            ]]></pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>

	<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
		<target>System.err</target>
		<encoder>
			<pattern><![CDATA[
%n%-4r [%d{yyyy-MM-dd HH:mm:ss}] %X{productionMode} - %X{method} %X{requestURIWithQueryString}[%file:%line][%method] [ip=%X{remoteAddr}, ref=%X{referrer}, ua=%X{userAgent}, sid=%X{cookie.JSESSIONID}]%n  %-5level %logger{35} - %m%n
            ]]></pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>


	<appender name="PROJECT" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>logs/myapp.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>logs/myapp%d{yyyy-MM-dd}.log</fileNamePattern>
			<maxHistory>30</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern><![CDATA[
%n%-4r [%d{yyyy-MM-dd HH:mm:ss}] %X{productionMode} - %X{method} %X{requestURIWithQueryString}[%file:%line][%method] [ip=%X{remoteAddr}, ref=%X{referrer}, ua=%X{userAgent}, sid=%X{cookie.JSESSIONID}]%n  %-5level %logger{35} - %m%n
            ]]></pattern>
		</encoder>
	</appender>

	<appender name="OPERATION" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>logs/operation.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>logs/operation%d{yyyy-MM-dd}.log</fileNamePattern>
			<maxHistory>30</maxHistory>
		</rollingPolicy>
		<encoder>
			<pattern><![CDATA[
%n%-4r [%d{yyyy-MM-dd HH:mm:ss}] %X{productionMode} - %X{method} %X{requestURIWithQueryString}[%file:%line][%method] [ip=%X{remoteAddr}, ref=%X{referrer}, ua=%X{userAgent}, sid=%X{cookie.JSESSIONID}]%n  %-5level %logger{35} - %m%n
            ]]></pattern>
		</encoder>
	</appender>

	<logger name="operationLog" level="INFO" additivity="false">
		<appender-ref ref="OPERATION" />
	</logger>

	<root level="WARN">
		<appender-ref  ref="STDOUT" />
		<appender-ref ref="STDERR" />
		<appender-ref ref="PROJECT" />
	</root>

</configuration>
 logback-test.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
	    <target>System.out</target>
		<encoder>
			<pattern>%d{HH:mm:ss}  %-5level %logger{35} - %msg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>
	
	<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
		<target>System.err</target>
		<encoder>
			<pattern>%d{HH:mm:ss}  %-5level %logger{35} - %msg%n</pattern>
			<charset>UTF-8</charset>
		</encoder>
	</appender>
	<logger name="org.apache" level="WARN" />
  	<logger name="org.springframework" level="WARN" />
    <logger name="org.mybatis.spring" level="WARN" />
	<logger name="org.springframework.jdbc.datasource" level="INFO" />
    <logger name="com.mycompany.myapp.dao" level="DEBUG" additivity="false">
    	<appender-ref ref="STDERR" />
    </logger>

	<root level="INFO">
		<appender-ref ref="STDOUT" />
	</root>

</configuration>
 sping-mybatis.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
      http://www.springframework.org/schema/aop
             http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-4.0.xsd">
	<!-- 组件扫描注解 -->
	<context:component-scan base-package="com.mycompany.myapp">
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
	</context:component-scan>

	<!-- JDBC属性 -->
	<context:property-placeholder location="classpath:jdbc.properties" />

	<!-- DBCP数据源 -->
	<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="${jdbc.driverClassName}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.username}" />
		<property name="password" value="${jdbc.password}" />
		<!-- 初始化连接大小 -->
		<property name="initialSize" value="${initialSize}"></property>
		<!-- 连接池最大数量 -->
		<property name="maxActive" value="${maxActive}"></property>
		<!-- 连接池最大空闲 -->
		<property name="maxIdle" value="${maxIdle}"></property>
		<!-- 连接池最小空闲 -->
		<property name="minIdle" value="${minIdle}"></property>
		<!-- 获取连接最大等待时间 -->
		<property name="maxWait" value="${maxWait}"></property>
		<!-- 连接被泄露时是否打印 -->
		<property name="logAbandoned" value="true" />
		<!--removeAbandoned: 是否自动回收超时连接 -->
		<property name="removeAbandoned" value="true" />
		<!--removeAbandonedTimeout: 超时时间(以秒数为单位) -->
		<property name="removeAbandonedTimeout" value="30" />
		<!-- 在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位. -->
		<property name="timeBetweenEvictionRunsMillis" value="10000" />
		<!-- 在每次空闲连接回收器线程(如果有)运行时检查的连接数量 -->
		<property name="numTestsPerEvictionRun" value="10" />
		<!-- 1000 * 60 * 30 连接在池中保持空闲而不被空闲连接回收器线程 -->
		<property name="minEvictableIdleTimeMillis" value="10000" />
		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
	</bean>

	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<!-- 配置mybatis配置文件的位置 -->
		<property name="mapperLocations" value="classpath*:sqlmap/mapping-*.xml"/>
		<property name="typeAliasesPackage" value="com.mycompany.myapp.domain" />
		<property name="plugins">
			<array>
				<bean class="com.github.miemiedev.mybatis.paginator.OffsetLimitInterceptor">
					<property name="dialectClass" value="com.github.miemiedev.mybatis.paginator.dialect.MySQLDialect"/>
				</bean>
			</array>
		</property>
	</bean>

	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<property name="basePackage" value="com.mycompany.myapp.dao" />
		<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
	</bean>
 	
	<!-- 事务管理 -->
	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource" />
	</bean>

	<!--事务模板 -->
	<bean id="transactionTemplate" class="org.springframework.transaction.support.TransactionTemplate">
		<property name="transactionManager" ref="transactionManager"></property>
		<!--ISOLATION_DEFAULT 表示由使用的数据库决定  -->
		<property name="isolationLevelName" value="ISOLATION_DEFAULT" />
		<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" />
		<!-- <property property="timeout" value="30"/> -->
	</bean>

	<!-- 注册事务注解  -->
	<tx:annotation-driven transaction-manager="transactionManager" />
	
	<!-- 切面注解配置 -->
	<aop:aspectj-autoproxy proxy-target-class="true"/>

	<!-- Freemarker配置 -->
	<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
		<property name="templateLoaderPath" value="/WEB-INF/view/" />
		<property name="freemarkerSettings">
			<props>
				<prop key="template_update_delay">0</prop>
				<prop key="default_encoding">UTF-8</prop>
				<prop key="number_format">0.##########</prop>
				<prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
				<prop key="classic_compatible">true</prop>
				<prop key="template_exception_handler">ignore</prop>
			</props>
		</property>
	</bean>

</beans>
 
分享到:
评论

相关推荐

    保存INI配置文件和读取配置文件

    INI 配置文件的保存和读取 INI 配置文件是一种常见的文件格式,用于存储程序的配置信息。它是一种简单的持久化机制,允许程序在启动时初始化配置信息。INI 文件由多个节(Section)组成,每个节中可以有多个键名...

    SourceInsight 4.0配置文件

    **SourceInsight 4.0配置文件详解** SourceInsight是一款强大的源代码分析和编辑工具,尤其在编程语言如C/C++、Java、C#等领域中广泛应用。它提供了高效的代码浏览、查找、编辑和理解功能,是软件开发人员提高工作...

    设置配置文件信息

    在IT行业中,配置文件是系统、应用程序或服务的重要组成部分,它们存储了运行时的参数和设置,以便根据需求调整程序的行为。"设置配置文件信息"这个主题涉及到如何读取、修改和管理这些文件,以便优化软件的性能或者...

    Android读写配置文件

    在Android开发中,读写配置文件是常见的任务,主要用于存储应用程序的设置、用户偏好或者其他持久化数据。配置文件通常以XML或JSON格式存在,因为它们结构清晰,易于解析。本实例将详细介绍如何在Android中进行读取...

    proe config配置文件大全

    标题中的“proe config配置文件大全”指的是针对Pro/Engineer Wildfire 5.0(简称ProE 5.0)软件的一系列配置文件集合。ProE是一款由PTC公司开发的三维参数化建模软件,广泛应用于产品设计和工程领域。配置文件是...

    C# winform 读取修改配置文件

    在C#编程中,Windows Forms(Winform)应用程序经常需要与配置文件进行交互,以便存储和检索应用设置。本文将详细讲解如何在Winform中读取和修改配置文件,特别是`appSettings`部分,这对于大多数桌面应用来说是至关...

    Linux C语言的配置文件操作库

    在Linux系统中,C语言作为底层编程的主要工具,其对配置文件的操作往往涉及到繁琐的文件I/O操作。然而,为了简化这一过程,开发者通常会利用特定的库来处理配置文件,比如读取、写入、解析键值对等。本文将深入探讨...

    海康威视配置文件解码专用工具器.rar

    本文将详细讲解海康威视配置文件解码的专业知识,以及如何利用“海康威视配置文件解码专用工具器”进行操作。 首先,了解什么是配置文件。在海康威视的设备中,配置文件通常包含了摄像头、NVR(网络视频录像机)或...

    Hikvision配置文件解码器.zip

    标题中的“Hikvision配置文件解码器.zip”指出,这是一个与解码Hikvision视频监控设备配置文件相关的工具或程序。Hikvision是全球知名的安防监控设备制造商,其产品广泛应用于各种场所,如家庭、商业设施、公共安全...

    vSphere 主机配置文件 5.5

    vSphere 主机配置文件是VMware vSphere虚拟化平台的一个重要组成部分,它允许IT管理员创建、管理和应用配置文件来标准化和自动化vCenter Server中的ESXi主机配置。使用vSphere主机配置文件可以提高效率并减少重复...

    笔记本颜色配置文件

    标题中的“笔记本颜色配置文件”指的是用于调整笔记本电脑显示屏色彩特性的ICC(International Color Consortium)配置文件。这种文件能够帮助用户校正显示器的色彩表现,确保显示的图像颜色与实际色彩更加接近,...

    LabVIEW 写入与读取配置文件

    在LabVIEW中,配置文件是用于存储应用程序设置、参数或状态的关键元素。这些文件通常以.ini或.xml格式存在,允许程序在运行时根据这些配置进行自定义行为。本教程将深入探讨如何在LabVIEW中进行配置文件的写入与读取...

    mac的颜色配置文件

    "mac的颜色配置文件",也就是苹果的ICC(International Color Consortium)配色文件,是这个过程中的重要组成部分。 ICC配色文件是一种标准化的方式,用来描述显示器、打印机、扫描仪等设备如何解释和再现颜色。这些...

    MACBook颜色配置文件Apple-MAC-OS-Color LCD.rar

    标题中的“MACBook颜色配置文件Apple-MAC-OS-Color LCD.rar”指的是为苹果MacBook设计的一种特定的颜色配置文件,这种文件通常以ICC(International Color Consortium)格式存在,用于优化显示器的色彩表现,确保...

    java 动态修改配置文件

    在Java开发中,配置文件是应用中不可或缺的一部分,它们通常包含系统设置、数据库连接信息、应用参数等。本文将深入探讨如何在Java中实现动态修改配置文件,同时解决中文字符编码问题,使得配置文件的读写更加高效和...

    C++读写ini配置文件

    在C++编程中,处理配置文件通常是为了存储和读取应用程序的设置或用户偏好。ini文件是一种常见的配置文件格式,其结构简单,易于理解和操作。本文将深入探讨如何使用C++来读写ini配置文件,主要参考提供的"rwconfig....

    创建默认的自定义windows用户配置文件

    ### 创建默认的自定义Windows用户配置文件 #### 知识点概述 在Windows操作系统中,创建自定义的默认用户配置文件是一项重要的系统管理和维护技术。这项技术尤其适用于那些需要多人共用一台计算机的情况,比如办公...

    creo3.0配置文件详细设置

    在三维建模软件Creo 3.0中,配置文件(.prf文件)是控制程序行为和用户界面的关键元素。这些文件允许用户根据个人习惯和项目需求定制软件的各个方面,包括显示设置、单位系统、内存分配、启动选项等。本篇文章将详细...

    foobar 均衡器 最强配置文件

    "foobar 均衡器 最强配置文件"指的是在音乐播放软件Foobar2000中使用的高级音频调整工具——均衡器的一种优化设置。Foobar2000是一款深受音乐爱好者喜爱的高质量音频播放器,它支持各种音频格式,并允许用户自定义...

    汇川伺服电机 Ethercat配置文件

    本篇将详细探讨"汇川伺服电机 Ethercat配置文件"的相关知识点,以及如何进行有效的配置。 EtherCAT(Ethernet for Control Automation Technology)是一种实时工业以太网协议,它允许高速数据传输和低延迟,非常...

Global site tag (gtag.js) - Google Analytics