복붙노트

[SPRING] Spring 데이터 설정 - hibernate.properties를 찾을 수 없음

SPRING

Spring 데이터 설정 - hibernate.properties를 찾을 수 없음

나는 이것과 이것에 기초하여 Hibernate in-memory 데이터베이스로 Spring Data를 설정하려고 시도한다 :

<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"/>

그러나 반복해서 나는 얻는다 :

문제는 내가 Spring 데이터없이 Spring에서 사용했던 것처럼 속성 파일에서 지정하고 싶지 않다는 것입니다. 기본 설정 인 Answer와 같이 XML 구성에서 설정하려고합니다. 내가 놓친 게 있니? 모든 도움을 위해 미리 감사드립니다.

해결법

  1. ==============================

    1.이 줄은 Hibernate의 정보 메시지 이상은 아닙니다. 아마도 hibernate.cfg.xml에 대해 불평하는 것과 비슷한 또 다른 것을 얻게 될 것이다.

    이 줄은 Hibernate의 정보 메시지 이상은 아닙니다. 아마도 hibernate.cfg.xml에 대해 불평하는 것과 비슷한 또 다른 것을 얻게 될 것이다.

    시동시 최대 절전 모드는이 두 파일을 사용하여 구성 될 수 있으며 최대 절전 모드는 이러한 파일이없는 경우 로그를 남깁니다. 아무것도 더 적은 아무것도. 당신은 그것을 무시할 수 있습니다.

  2. from https://stackoverflow.com/questions/39558028/spring-data-configuration-hibernate-properties-not-found by cc-by-sa and MIT license