Created
February 19, 2015 13:38
-
-
Save ivanursul/b58be0c56d8fd46037dd to your computer and use it in GitHub Desktop.
Dao.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.lnu.is.dao.dao; | |
| import org.lnu.is.pagination.MultiplePagedSearch; | |
| import org.lnu.is.pagination.PagedResult; | |
| /** | |
| * Interface, that has all methods, that are needed | |
| * to work with entities. | |
| * @author ivanursul | |
| * | |
| * @param <ENTITY> Entity class. | |
| * @param <KEY> Identifier class. | |
| */ | |
| public interface Dao<ENTITY, KEY> { | |
| /** | |
| * Method for finding Entities by Id. | |
| * @param id identifier. | |
| * @return Entity. | |
| */ | |
| ENTITY getEntityById(KEY id); | |
| /** | |
| * Method for saving entity. | |
| * @param entity entity. | |
| */ | |
| void save(ENTITY entity); | |
| /** | |
| * Method for updating entity. | |
| * @param entity entity. | |
| */ | |
| void update(ENTITY entity); | |
| /** | |
| * Method for deleting entity. | |
| * @param entity entity. | |
| */ | |
| void delete(ENTITY entity); | |
| /** | |
| * Method for getting paged Result. | |
| * @param pagedSearch | |
| * @return paged result. | |
| */ | |
| PagedResult<ENTITY> getEntities(MultiplePagedSearch<ENTITY> pagedSearch); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment