无法解决班级方言

问题描述 投票:1回答:1

我试图解决一个问题几个小时,但似乎没有任何工作。我尝试了在线提供的一切。我正在使用Intellij IDEA。我正在使用Maven项目。我创建了hibernate.cfg.xml以及以下内容

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
    <session-factory>
        <property name="connection.driver_class">org.h2.Driver</property>
        <property name="connection.url">jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</property>
        <property name="dialect">org.hibernate.dialect.H2Dialect</property>
        <property name="show_sql">true</property>
        <property name="hbm2ddl.auto">create</property>
        <mapping class="User"/>
    </session-factory>
</hibernate-configuration>

以下行抛出了无法解析类dialect的错误

<property name="dialect">org.hibernate.dialect.H2Dialect</property>

我的外部库结构如下所示。

enter image description here

任何帮助,将不胜感激。

java hibernate maven intellij-idea
1个回答
1
投票

我解决了这个问题。问题是Intellij IDEA无法下载Hibernate的maven文件。我使用maven repository添加存储库。

© www.soinside.com 2019 - 2024. All rights reserved.