2013-05-07 55 views
0

我對Spring和Hibernate有一個很奇怪的問題。 我已經配置了一切,我的database.properties,hibernate.xml和datasource.xml 正如我在教程中看到的,但連接不起作用。休眠會話不能在春天工作

當我改變連接屬性時,它不會改變任何東西。

我hibernate.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

<!-- Hibernate session factory --> 
<bean id="sessionFactory" 
    class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> 

    <property name="dataSource"> 
     <ref bean="dataSource"/> 
    </property> 

    <property name="hibernateProperties"> 
     <props> 
     <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> 
     <prop key="hibernate.show_sql">true</prop> 
     </props> 
    </property> 

    <property name="packagesToScan"> 
     <list> 
      <value>pl.devell.model</value> 
     </list> 
    </property> 

</bean> 

吾道類工作,但沒有返回任何結果。

回答

0

我想通了。

pl.devell.model不是要掃描的軟件包的正確名稱。