Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Seperation of DAO's in SPRING

 
Uppala Srinivas
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use DaoFactory, and create DAO using BUSINESS_PREFIX:
 
Julius Fernandes
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thing you could look at is, the NamingStrategy interface in Hibernate. Why not try that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic