Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/io/khasang/pm/dao/BasicDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@ public interface BasicDao<T> {
*/
T add(T entity);

/**
* updating entity in db
*
* @param entity - entity for update in db
* @return udated entity
*/
T update(T entity);

/**
* deleting entity in db
*
* @param entity - entity for deleting from db
* @return deleted entity
*/
T delete(T entity);

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/khasang/pm/entity/ChildDocument.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import javax.persistence.*;

@Entity
//@Table(name = "documents")
public class ChildDocument {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/io/khasang/pm/service/ChildDocumentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,42 @@
import java.util.List;

public interface ChildDocumentService {
/**
* required for adding childDocument to db
*
* @param childDocument - childDocument for adding
* @return added childDocument
*/
ChildDocument add(ChildDocument childDocument);

/**
* required for updating childDocument in db
*
* @param childDocument - childDocument for update
* @return updated childDocument
*/
ChildDocument update(ChildDocument childDocument);

/**
* required for deleting childDocument from db
*
* @param id - childDocument's id for deleting
* @return deleted childDocument
*/
ChildDocument delete(long id);

/**
* getting specify childDocument by ID from db
*
* @param id - childDocument's id for receiving
* @return childDocument by id
*/
ChildDocument getById(long id);

/**
* getting all childDocuments
*
* @return all childDocument from db
*/
List<ChildDocument> getAllChildDocuments();
}