The merging of collection is allowed in the Spring 2.0. A parent-style like <list/>, <map/>, <set/> or <pros/> element can have child-style <list/>, <map/>, <set/> or <pros/> element which inherit and overrides the values from the parent collection. For collection merging you need to specify merge=true attribute on the <props/> element of child bean definition. Note you cannot merge Map and List collection type.
CollegeBean.java
package collection.merge.example;
|
ProsMain.java
package collection.merge.example;
|
context.xml
<bean id="parent" abstract="true"
|
| College [Props={Name=Rohit Raj, Roll=101, Year=25, NickName=Raj}] |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.