Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Wiring lists and arrays in spring

I was reading folowing line and I did not understand clearly.

Wiring lists and arrays

 When using Hibernate with Spring,
you willl wire a LocalSessionFactoryBean into the container. The LocalSession
FactoryBean has a mappingResources property that takes a List of Strings containing
the names of Hibernate mapping files. Here’s a snippet of XML that we will
introduce to the bean wiring file when we get around to talking about Hibernate:
<bean id="sessionFactory" class=
"org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>/com/springinaction/training/model/Course.hbm.xml</value>
<value>/com/springinaction/training/model/Student.hbm.xml</value>
</list>
</property>

</bean>
Although the previous snippet wires a List of String values, you are not limited
to using only <value>s as entries in a <list>. You may use any element that is
valid when wiring a singular property, including <value>, <ref>, or even another
collection such as <list>. The only limitation is in what your beans expectations
are
 you can not wire in a List of Foos when your bean is expecting a List of Bars.

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
0
gudii9
Asked:
gudii9
1 Solution
 
objectsCommented:
Its saying you your list can also contain beans
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now