Invalid property 'annotatedClasses' of bean class
在整合Hibernate和Spring时出现,Invalid property 'annotatedClasses' of bean class
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation. AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>org.yinpan.hibernate.GuestBook</value>
</list>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3. LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/yinpan/hibernate/GuestBook.hbm.xml</value>
</list>
</property>
</bean>
上面只需要注意红色部分就行了,注解实体与XML方式引用的类是不一样的。
引自:http://www.blogjava.net/yinpan/archive/2011/07/07/353845.html
在整合Hibernate和Spring时出现,Invalid property 'annotatedClasses' of bean class
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation. AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>org.yinpan.hibernate.GuestBook</value>
</list>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3. LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/yinpan/hibernate/GuestBook.hbm.xml</value>
</list>
</property>
</bean>
上面只需要注意红色部分就行了,注解实体与XML方式引用的类是不一样的。
引自:http://www.blogjava.net/yinpan/archive/2011/07/07/353845.html