File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Seperation of DAO's in SPRING Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Seperation of DAO Watch "Seperation of DAO New topic

Seperation of DAO's in SPRING

Uppala Srinivas

Joined: May 11, 2006
Posts: 8

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"/>

Sample Query in DAO Implemetation


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

Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
You can use DaoFactory, and create DAO using BUSINESS_PREFIX:

SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Julius Fernandes

Joined: Oct 10, 2004
Posts: 2
First thing you could look at is, the NamingStrategy interface in Hibernate. Why not try that.
I agree. Here's the link:
subject: Seperation of DAO's in SPRING
It's not a secret anymore!