Skip to content
Snippets Groups Projects
Commit e7c21ead authored by Dominika Zemanovičová's avatar Dominika Zemanovičová Committed by Martin Gargalovič
Browse files

Add delete method

parent 98089eaa
No related branches found
No related tags found
3 merge requests!31M2,!28M2 user,!27Draft: M2 user
...@@ -47,9 +47,11 @@ public interface DomainRepository<T, ID> { ...@@ -47,9 +47,11 @@ public interface DomainRepository<T, ID> {
T update(T entity); T update(T entity);
/** /**
* Delete entity with the specified ID * Delete the entity with the specified id
* Note that this does not do cascade deleting.
* We will have cascade deleting with usage of JpaRepository
* *
* @param id the ID of the entity to be deleted * @param id the id of the entity to be deleted
*/ */
void deleteById(ID id); void deleteById(ID id);
} }
\ No newline at end of file
...@@ -93,9 +93,11 @@ public abstract class DomainRepositoryImpl<T extends DomainObject> implements Do ...@@ -93,9 +93,11 @@ public abstract class DomainRepositoryImpl<T extends DomainObject> implements Do
} }
/** /**
* Delete entity with the specified ID * Delete the entity with the specified id
* Note that this does not do cascade deleting.
* We will have cascade deleting with usage of JpaRepository
* *
* @param id the ID of the entity to be deleted * @param id the id of the entity to be deleted
*/ */
@Override @Override
public void deleteById(String id) { public void deleteById(String id) {
......
...@@ -38,4 +38,12 @@ public abstract class DomainService<T extends DomainObject> { ...@@ -38,4 +38,12 @@ public abstract class DomainService<T extends DomainObject> {
public T update(T entity) { public T update(T entity) {
return getRepository().update(entity); return getRepository().update(entity);
} }
/**
* Delete an entity with specified id
* @param id id of the entity to delete
*/
public void delete(String id) {
getRepository().deleteById(id);
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment