aspose file tools*
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 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Seperation of DAO Watch "Seperation of DAO New topic
Author

Seperation of DAO's in SPRING

Uppala Srinivas
Greenhorn

Joined: May 11, 2006
Posts: 8
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

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
Greenhorn

Joined: Oct 10, 2004
Posts: 2
First thing you could look at is, the NamingStrategy interface in Hibernate. Why not try that.
 
 
subject: Seperation of DAO's in SPRING
 
Similar Threads
Deleting a record from one table deletes record from another table too
Transaction doesn't rollback
Hibernate cannot open connection
Dynamic ACL's in Acegi.
Spring Framework and Hibernate