Hibernate Implementation
There are two primary steps to creating either orientation of a Repository. You need to define a public interface and at least one implementation.
Specifically in the case of a collection-oriented design, in the first step you define an interface that mimics a collection. The second step provides an implementation that addresses the use of the backing primary storage mechanism, such as Hibernate. The interface, like a collection, will often have common methods such as are found in the following example:
package com.saasovation.collaboration.domain.model.calendar; public interface CalendarEntryRepository { public void add(CalendarEntry aCalendarEntry); public void addAll( Collection<CalendarEntry> ...
Get Implementing Domain-Driven Design now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.