This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes DAO for persistence layer 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 » Databases » Object Relational Mapping
Bookmark "DAO for persistence layer" Watch "DAO for persistence layer" New topic

DAO for persistence layer

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
While writing DAO for implementing the persistence layer, are there some core persistence services, that should be implemented by DAO.

Please advise.

Thanks in advance.

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 661

core persistence services

- Please explain and expand what do you mean by core persistence services.
But from what I've understood (and assuming you're not using any ORM) the general services would be,

1. Find rows by primary key.
2. Save a row.
3. Save a bunch of rows.
4. Cascade save rows (typically parent-child entities).
5. Form dynamic sql based on search conditions (search condition can be generic or specific).
6. Update/delete a row based on primary key.
7. Services which would open/close transactions (point-point or distributed).
8. Services which would do logging of DB operations (If you plan to have in your application)
These are some of the things which comes to the top of my mind.

If you are not laughing at yourself, then you just didn't get the joke.
I agree. Here's the link:
subject: DAO for persistence layer
It's not a secret anymore!