There is no single best solution, the problem you stated is the choice between the repository and the active samples.
As a rule, the repository is more suitable for unit testing, since the repository's interfaces are easily washed out, and the principles of High Cohesion and Single Responsibility are used in the repository template (from the point of view of OOP, it may seem strange that your business object will contain code for saving to your database, transferring yourself over the network or exporting to some XML files, etc.)
Active recording can provide great speed in RAD development, and some tools, such as Spring Roo, were initially developed only to support Active Record, repository support was added only recently, as I know. AFAIK Ruby On Rails uses active writing and some other great tools.
As for Domain Driven Design, you should use the Repository as Jeroen suggested, because the repository is the basic DDD template (this is the central version of the DAO template), but you should check if your tools have direct support for any template,
source share