如何禁用jpa命名查询?或忽略扫描“ jpa-named-queries.properties”文件

时间:2018-08-31 06:10:35

标签: spring hibernate spring-data-jpa

日志:

[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []
[main] [DEBUG org.springframework.core.io.support.PathMatchingResourcePatternResolver] org.springframework.core.io.support.PathMatchingResourcePatternResolver.findAllClassPathResources(PathMatchingResourcePatternResolver.java:321)
Resolved classpath location [META-INF/jpa-named-queries.properties] to resources []

扫描文件'jpa-named-queries.properties',但是我的项目或任何jar中都没有此文件。因此可以禁用jpa命名查询或忽略扫描该文件吗?

我的配置文件:

<context:annotation-config />
<jpa:repositories base-package="<hidden>.*.dao" />
<context:component-scan base-package="<hidden>.*.service.impl" />

<task:scheduler id="defaultTaskScheduler" pool-size="${default.TaskScheduler.poolSize}" />
<context:component-scan base-package="<hidden>.*.task.*" />

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="jpaVendorAdapter">
        <bean
            class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        </bean>
    </property>
    <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan" value="<hidden>.*.po" />
    <property name="jpaPropertyMap">
        <map>
            <entry key="hibernate.show_sql" value="${hibernate.show_sql}" />
            <entry key="hibernate.format_sql" value="${hibernate.format_sql}" />
            <entry key="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" />
            <entry key="hibernate.dialect" value="${hibernate.dialect}" />
            <entry key="hibernate.enable_lazy_load_no_trans" value="true" />
        </map>
    </property>
</bean>

<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

我项目中的jar:spring,hibernate,commons,curator,jackson,mysql ...

0 个答案:

没有答案