• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Seperation of DAO's in SPRING

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We have Same DAO implementation for different business,differenting using BUSINESS_PREFIX will use repsective tables to process.We need to seperate logic having individual DAO implemetations for each business unit.Please provide a solution.

<bean id="programPrioritizationDAO" class="com.test.JdbcProgramPrioritizationDAOImpl">
<property name="dataSource" ref="dataSource"/>
</bean>

Sample Query in DAO Implemetation

"SELECT "+Constants.BUSINESS_PREFIX+"GET_PPO_CDE_STATUS(?,'PPO_STATUS')AS PRIORITIZATION_STATUS FROM DUAL";

Depending upon the business ,Constants.BUSINESS_PREFIX will be replaced to use the corresponding tables to fecth the data
.

Thanks,
Srini
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use DaoFactory, and create DAO using BUSINESS_PREFIX:
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First thing you could look at is, the NamingStrategy interface in Hibernate. Why not try that.
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic