Java 休眠表不存在错误

Java 休眠表不存在错误,java,hibernate,Java,Hibernate,我真的需要你的帮助 我是新来的冬眠者。正在尝试保存对象,但始终出现错误: 原因:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:表“hibernate.person”不存在 以下是域对象: @Table(name = "Person") @Entity public class Person { @Id @GeneratedValue(strategy = GenerationType.AUTO) pr

我真的需要你的帮助

我是新来的冬眠者。正在尝试保存对象,但始终出现错误:

原因:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:表“hibernate.person”不存在

以下是域对象:

@Table(name = "Person")
@Entity
public class Person {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private String id;
    @Column(name = "Person_age")
    private int age;
    @Column(name = "Person_name")
    private String name;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
这是我的hibernate配置文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://localhost:3306/hibernate</property>
        <property name="connection.username">root</property>
        <property name="connection.password">******</property>
        <property name="connection.pool_size">1</property>
        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Show all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">create</property>

        <!-- Mapping files -->
        <mapping class="ua.macko.domain.Person" />

    </session-factory>
</hibernate-configuration>    
我得到的错误是:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:表'hibernate.person'不存在

我试图将hbm2ddl.auto参数设置为创建和更新,但没有结果

请告诉我我做错了什么

提前通知

<property name="hbm2ddl.auto">create</property>

相反。

添加javassist库后,问题已经解决。谢谢大家的帮助

试着创造而不是创造我也试过这件事。没有帮助。可能是@macko的副本,请检查完整的日志,看看hibernate是否能够成功创建表,我想hibernate在创建表时遇到了一些问题。@Chaitanya,它没有创建表,我不知道为什么
<property name="hibernate.hbm2ddl.auto">create</property>