MyBatis3 generator reports errors when generating entity classes and xml files

MyBatis3 generator reports errors when generating entity classes and xml files

Just add the following code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
	<classPathEntry location="D:\mssql-jdbc-6.2.2.jre8.jar"></classPathEntry>

	<context id="context1"  targetRuntime="MyBatis3">
		<commentGenerator>
			<!-- 是否去除自动生成的注释 true:-->
			<property name="suppressAllComments" value="true" />
			<!-- 是否生成注释时间戳 -->
			<property name="suppressDate" value="true" />
		</commentGenerator>

		<jdbcConnection
			connectionURL="jdbc:oracle:thin:@192.168.50.240:1521:orcl"
			driverClass="oracle.jdbc.driver.OracleDriver" password="supmists"
			userId="supmists">
		</jdbcConnection>
		<!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制 -->
		<javaTypeResolver>
			<property name="forceBigDecimals" value="false" />
		</javaTypeResolver>
		<javaModelGenerator
			targetPackage="org.skyviewpacs.logSys.pojo.localMasterNew"
			targetProject="skyview-logSystem">
			<!-- 是否允许子包,即targetPackage.schemaName.tableName -->
			<property name="enableSubPackages" value="false" />
			<!-- 是否对model添加 构造函数 -->
			<property name="constructorBased" value="true" />
			<!-- 是否对类CHAR类型的列的数据进行trim操作 -->
			<property name="trimStrings" value="true" />
			<!-- 建立的Model对象是否 不可改变 即生成的Model对象不会有 setter方法,只有构造方法 -->
			<property name="immutable" value="false" />
		</javaModelGenerator>

		<sqlMapGenerator targetPackage="org.skyviewpacs.logSys.dao.localMasterNew"
			targetProject="skyview-logSystem">
			<property name="enableSubPackages" value="false" />
		</sqlMapGenerator>

		<javaClientGenerator
			targetPackage="org.skyviewpacs.logSys.dao.localMasterNew"
			targetProject="skyview-logSystem" type="XMLMAPPER">
			<property name="enableSubPackages" value="false" />
		</javaClientGenerator>


		<!-- <table tableName="COMM_OPERATION_CLASS_DICT"></table> -->
		<!-- <table tableName="COMM_OPERATION_DICT"></table> -->
		<!-- <table tableName="inp_ops_arrange"></table> -->
		<!-- <table tableName="V_INP_PATS_IN_DEPT"></table> -->
		<!-- <table tableName="COMM_PERSON"></table> -->
		<table tableName="HP_QUEUE_CALL_COUNT"></table>
		<!-- <table tableName="COMM_DEPT"></table>
		<table tableName="exam_app_item"></table>
		<table tableName="exam_app_master"></table> -->
	</context>





</generatorConfiguration>

Add targetRuntime="MyBatis3" to the context tag

Guess you like

Origin blog.csdn.net/weixin_44215804/article/details/110850013