在我的applicationContext.xml中,這是我如何將xml映射到POJO。如何將目錄映射到類文件而不需要創建xml?spring + hibernate映射類沒有xml
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>com/custompackage/custom/spi/hibernate3/HibernateCurrentStep.hbm.xml</value>
<value>com/custompackage/custom/spi/hibernate3/HibernateHistoryStep.hbm.xml</value>
<value>com/custompackage/custom/spi/hibernate3/HibernatecustomEntry.hbm.xml</value>
<value>user/custom/hibernate3/PropertySetItemImpl.hbm.xml</value>
<value>com/custompackage/user/provider/hibernate3/user/impl/HibernateGroupImpl.hbm.xml</value>
<value>com/custompackage/user/provider/hibernate3/user/impl/HibernateUserImpl.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
.....
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
我應該在我的AnnotationSessionFactoryBean中將類映射轉換爲什麼? – 2016-12-04 05:21:05
@嘉亞洲你能否詳細說明一下,我不太清楚你在問什麼。 – 2016-12-05 14:28:38
如果在我的一個實體中,我添加了一個OneToOne映射到另一個實體的屬性。我應該在Spring框架xml配置中添加什麼來實現它?你可以在這裏查看我的問題的細節:http://stackoverflow.com/questions/40956208/how-to-configure-hibernate-onetoone-mapping-using-spring-framework – 2016-12-06 15:08:33