2013-05-07 53 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不是要扫描的软件包的正确名称。