aspose file tools*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "DAO for persistence layer" Watch "DAO for persistence layer" New topic
Author

DAO for persistence layer

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
Hi,
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: 513

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.
 
jQuery in Action, 2nd edition
 
subject: DAO for persistence layer