Herbarnate 的映射文件.hbm.xml自动生成表报错。

用hbm.xml映射文件自动生成表报错!

严重: Unsuccessful: create table alipay_table (id integer not null auto_increment, partner varchar(50), key varchar(50), seller_email varchar(50), createTime varchar(30), updateTime varchar(30), updateAdmin varchar(30), primary key (id))
2008-11-4 16:18:17 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
严重: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(50), seller_email varchar(50), createTime varchar(30), updateTime varcha' at line 1

 配置映射文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="org.deal.model">
	<class name="AliPay" table="alipay_table">
		<id name="id" column="id">
			<generator class="identity" />
		</id>
		<property name="partner" column="partner" type="string" length="50" />
		<property name="key" column="key" type="string" length="50" />
		<property name="seller_email" column="seller_email" type="string" length="50" />
		<property name="createTime" column="createTime" type="string" length="30" />
		<property name="updateTime" column="updateTime" type="string" length="30" />
		<property name="updateAdmin" column="updateAdmin" type="string" length="30" />
	</class>
</hibernate-mapping>

 

错误为:key  是关键字。所以生成的SQL不能执行!!报错

你可能感兴趣的:(sql,xml,Hibernate,mysql,SQL Server)