I've been looking at the DAO design pattern and want to expand it to provide result set paging and relationship management. Therefore my DAO class looks something like:

public class ItemDAO
{
// Core CRUD operations.
public void create (Item pDTO) ...
public Item read (Integer pPrimaryKey) ...
public void update (Item pDTO) ...
public void delete (Item pDTO) ...

// Core result set paging operations.
public void read (String queryString) ...
public Collection getFirst () ...
public Collection getNext () ...
public Collection getPrevious () ...
public Collection getLast () ...
}

This address the result set paging problem but I'm not sure how to tackle the relationship management issue. The most appropriate way to do it I guess is to ensure that each DTO (e.g. Item) has attributes that hold the primary keys of relate objects?

Any comments would be very appreciated...

P.