【发布时间】:2012-02-01 05:22:45
【问题描述】:
我想使用 p-namespace 重写我的 sessionFactory bean。我了解如何引用一般对象,但我从未处理过列表、道具等。我将如何进行写作等等?
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>/com/mysite/domain/Object.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>
这是我目前在 p-namespace 中的代码:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
p:dataSource-ref="dataSource"
p:mappingResources-list="/com/mysite/domain/Object.hbm.xml"
p:hibernateProperties-props=""/>
【问题讨论】: