Unable to automatically create table Summary based on hibernate.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.