Create the Repository
If you want to access the database and apply operations to your entity, a repository must be defined.
Keep in mind that the repository isn't a class
. It's just an interface
!
To ensure type safety, the type of the entity and the identifier must be specified as type parameters of the Repository<E, K>
interface.
ATTENTION:
First type is the ENTITY (
<E>
)Second type is the KEY of the ENTITY (
<K>
)
Example repository CustomerRepository
:
Last updated