<
property
name
="hbm2ddl.auto"
>
create
</
property
>
2.表中有关键字,如:
order,level,address,degree等。
3.将
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
替换成
<property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
MysqlDialect这个是比较老的,如果你是用的mysql5,最好是用MySQL5Dialect,后面的方言是针对mysql5的一些新特性做了一些优化的,更快了效率,Mysql5Dialect是继承了MysqlDialect的所以MysqlDialect能干的事 Mysql5Dialect都能干。
4.在配置文件中不小心写了两个同名属性,如:
<?
xml version="1.0"
?>
<! DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
< hibernate-mapping package ="org.hibernate.auction" >
< class name ="com.runsky.domain.AdditionalInformation"
table ="AdditionalInformation" lazy ="false" >
< id name ="id" column ="ID" length ="32" >
< generator class ="uuid.hex" />
</ id >
< property name ="tag" column ="tag" />
< property name ="content" column ="content" />
<property name="id" column ="id" />
</ class >
</ hibernate-mapping >
<! DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
< hibernate-mapping package ="org.hibernate.auction" >
< class name ="com.runsky.domain.AdditionalInformation"
table ="AdditionalInformation" lazy ="false" >
< id name ="id" column ="ID" length ="32" >
< generator class ="uuid.hex" />
</ id >
< property name ="tag" column ="tag" />
< property name ="content" column ="content" />
<property name="id" column ="id" />
</ class >
</ hibernate-mapping >