Unable to automatically create table Summary based on hibernate.
I just tried to write an example project with Hibernate, but it was hard to catch up with it for a day. I have been reporting that I cannot create a table. Now I will share my experience with you:
1. Writing problems:
<property name="hbm2ddl.auto">create</property>
You can create or update a table in the middle. When you cannot create a table, check whether the table is correctly written.
2. The ing file of Mapping has the same name, for example:
<mapping resource="com/runsky/domain/Status.hbm.xml" /><mapping resource="com/runsky/domain/Status.hbm.xml" />
3. The table contains keywords, such:
Order, level, address, degree, from, etc. (I use the from keyword)
4. Two attributes with the same name are accidentally written in the configuration file, for example:
<?xml version="1.0"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
5. The full class name is incorrect.