<i id='bJpzg'><tr id='bJpzg'><dt id='bJpzg'><q id='bJpzg'><span id='bJpzg'><b id='bJpzg'><form id='bJpzg'><ins id='bJpzg'></ins><ul id='bJpzg'></ul><sub id='bJpzg'></sub></form><legend id='bJpzg'></legend><bdo id='bJpzg'><pre id='bJpzg'><center id='bJpzg'></center></pre></bdo></b><th id='bJpzg'></th></span></q></dt></tr></i><div id='bJpzg'><tfoot id='bJpzg'></tfoot><dl id='bJpzg'><fieldset id='bJpzg'></fieldset></dl></div>
    <tfoot id='bJpzg'></tfoot>

      <bdo id='bJpzg'></bdo><ul id='bJpzg'></ul>
      <legend id='bJpzg'><style id='bJpzg'><dir id='bJpzg'><q id='bJpzg'></q></dir></style></legend>
      1. <small id='bJpzg'></small><noframes id='bJpzg'>

      2. Spring Data 配置 - hibernate.properties 未找到

        时间:2024-08-23

        • <legend id='caE1P'><style id='caE1P'><dir id='caE1P'><q id='caE1P'></q></dir></style></legend>
        • <i id='caE1P'><tr id='caE1P'><dt id='caE1P'><q id='caE1P'><span id='caE1P'><b id='caE1P'><form id='caE1P'><ins id='caE1P'></ins><ul id='caE1P'></ul><sub id='caE1P'></sub></form><legend id='caE1P'></legend><bdo id='caE1P'><pre id='caE1P'><center id='caE1P'></center></pre></bdo></b><th id='caE1P'></th></span></q></dt></tr></i><div id='caE1P'><tfoot id='caE1P'></tfoot><dl id='caE1P'><fieldset id='caE1P'></fieldset></dl></div>
            <bdo id='caE1P'></bdo><ul id='caE1P'></ul>
              <tbody id='caE1P'></tbody>
              <tfoot id='caE1P'></tfoot>

                  <small id='caE1P'></small><noframes id='caE1P'>

                  本文介绍了Spring Data 配置 - hibernate.properties 未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试使用 Hibernate 内存数据库配置 Spring Data,基于 this 和 这个答案:

                  I try to configure Spring Data with Hibernate in-memory database, based on this and this answers:

                  <beans xmlns="http://www.springframework.org/schema/beans"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xmlns:jpa="http://www.springframework.org/schema/data/jpa"
                         xmlns:tx="http://www.springframework.org/schema/tx"
                         xmlns:jdbc="http://www.springframework.org/schema/jdbc"
                    xsi:schemaLocation="http://www.springframework.org/schema/beans
                  http://www.springframework.org/schema/beans/spring-beans.xsd
                  http://www.springframework.org/schema/data/jpa
                  http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd
                  http://www.springframework.org/schema/tx
                  http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
                  
                     http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
                  
                  <!-- Configure the data source bean -->
                  <jdbc:embedded-database id="dataSource" type="HSQL">
                  </jdbc:embedded-database>
                  
                  <!-- Create default configuration for Hibernate -->
                  <bean id="hibernateJpaVendorAdapter"
                        class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                      <property name="generateDdl" value="false">
                      </property>
                  </bean>
                  
                  <!-- Configure the entity manager factory bean -->
                  <bean id="entityManagerFactory"
                        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                      <property name="dataSource" ref="dataSource"/>
                      <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
                      <property name="persistenceUnitName" value="punit"/>
                      <property name="jpaPropertyMap">
                          <map>
                              <entry key="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"></entry>
                              <entry key="hibernate.hbm2ddl.auto" value="create"></entry>
                              <entry key="hibernate.show_sql" value="true"></entry>
                          </map>
                      </property>
                      <property name="packagesToScan" value="models"/>
                      <property name="sharedCacheMode" value="ENABLE_SELECTIVE"/>
                      <property name="validationMode" value="NONE"/>
                  </bean>
                  <bean id="transactionManager"
                        class="org.springframework.orm.jpa.JpaTransactionManager">
                      <property name="entityManagerFactory" ref="entityManagerFactory"/>
                  </bean>
                  <tx:annotation-driven/>
                  <jpa:repositories base-package="beans.repositories"/>
                  

                  但我一遍又一遍地得到:

                  But over and over again I get:

                  org.hibernate.cfg.Environment.HHH000206: hibernate.properties 未找到

                  org.hibernate.cfg.Environment. HHH000206: hibernate.properties not found

                  问题是我不想在 properties 文件中指定它,因为我以前没有 Spring Data 我想在 xml 配置中设置它,就像在我根据的答案.我错过了什么吗?提前感谢您的每一个帮助.

                  Problem is that I don't want to specify it in properties file, as I used to without Spring Data I want to set it in xml configuration, like in answers which I base. Am I missing something? Thank you in advance for every help.

                  推荐答案

                  那一行只不过是来自 Hibernate 的信息消息.您可能会收到另一个与此类似的抱怨 hibernate.cfg.xml.

                  That line is nothing more then an information message from Hibernate. You probably get another one similar to this one complaining about hibernate.cfg.xml.

                  在启动时,可以使用这 2 个文件配置休眠模式,并且休眠会记录这些文件的缺失.不多不少.你可以直接忽略它.

                  At startup hibernate may be configured using those 2 files and hibernate logs the absence of those. Nothing more nothing less. You can simply ignore it.

                  这篇关于Spring Data 配置 - hibernate.properties 未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 Hibernate 为 Spring data JPA 的所有查找方法添加全局 where 子句? 下一篇:将模式名称添加到 Spring 数据中的实体?

                  相关文章

                  <small id='i7ywV'></small><noframes id='i7ywV'>

                  <legend id='i7ywV'><style id='i7ywV'><dir id='i7ywV'><q id='i7ywV'></q></dir></style></legend>
                  <tfoot id='i7ywV'></tfoot>

                    1. <i id='i7ywV'><tr id='i7ywV'><dt id='i7ywV'><q id='i7ywV'><span id='i7ywV'><b id='i7ywV'><form id='i7ywV'><ins id='i7ywV'></ins><ul id='i7ywV'></ul><sub id='i7ywV'></sub></form><legend id='i7ywV'></legend><bdo id='i7ywV'><pre id='i7ywV'><center id='i7ywV'></center></pre></bdo></b><th id='i7ywV'></th></span></q></dt></tr></i><div id='i7ywV'><tfoot id='i7ywV'></tfoot><dl id='i7ywV'><fieldset id='i7ywV'></fieldset></dl></div>

                        <bdo id='i7ywV'></bdo><ul id='i7ywV'></ul>