Announcement Announcement Module
No announcement yet.
How to merging list from different context files? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to merging list from different context files?

    Hi all,

    I have a requirement in which i have to create a generic DAO project and all other project which needs to persist something will use this generic dao jar.

    So how i want this to work is when i configure a ListFactoryBean in my generic DAO the sourceList property will be blank and subsequently the projects which uses this jar will create some sort of bean or list in their context xml and which should get merged with DAO's sourceList when the context loads.

    So we can say that ListFactoryBean of generic DAO as parent and all other projects which uses it will be child. So when the context loads all the child's hbm mappings should be combined and set to this ListFactoryBean's sourceList property.

    So, for ex i will have something like this in my generic DAO's application context -

    <bean id="mappingResources" class="org.springframework.beans.factory.config.Li stFactoryBean">
    <property name="sourceList">
    <!-- all hbm mappings should come here from difeerent sources when the context is loaded-->

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref local="mySQLDataSource" />
    <property name="mappingResources">
    <ref bean="mappingResources" />
    <property name="hibernateProperties">

    Please help me how can i achieve something like this? I hope you all understood what i am trying to say?
    Last edited by kapil_bsp; Jan 7th, 2009, 01:45 AM. Reason: No body is replying, may be people are not able to understand.