有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Hibernate:TableThingsDB。事情并不存在

我试图使用Hibernate从数据库中检索我的所有Thing,但出现以下错误:

Table 'thingsdb.Things' doesn't exist org.hibernate.exception.SQLGrammarException: could not execute query

数据库中的表实际上被命名为things,而不是Things

我正在执行的查询如下:

List<Thing> listofthings = session.createQuery(" from Thing thing").list();

还有hibernate xml:

<hibernate-configuration>
    <session-factory>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://localhost/mythings</property>
        <property name="connection.username">root</property>
        <property name="connection.password"></property>
        <property name="connection.pool_size">5</property>
        <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
        <property name="show_sql">true</property>
        <mapping class="mythings.Thing" />
    </session-factory>
</hibernate-configuration>

我试图寻找解决办法,但没有找到。我刚开始冬眠,所以我真的不知道该找什么或去哪里


共 (0) 个答案