Avoid duplicated info in the Spring application context

Some configuration is shared across many projects and duplication must be avoided, e.g. for hibernate configuration this can be achieved using ArrayList for properties of type List and a custom class HibernateProperties for properties of type Properties.

    
        
            
        
        
            
        
        
            
        
    

    
        
            
                ${hibernate.dialect}
                ${hibernate.show_sql}
                ${hibernate.hbm2ddl.auto}
            
        
    

    
        
            
                net/sf/oness/party/model/party/bo/Party.hbm.xml
            
        
    

This way mappingResources can be overriden in each project for their set of classes and hibernateProperties can also be overriden to get values from JNDI as I do in the ONess project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s