Package br.com.trajy.architecture.base
Class AbstractPanacheAssembly<D,E extends io.quarkus.hibernate.orm.panache.PanacheEntity>
java.lang.Object
br.com.trajy.architecture.base.AbstractPanacheAssembly<D,E>
- Type Parameters:
D
- Data Transfer Object Type (DTO)E
- Entity Type
public abstract class AbstractPanacheAssembly<D,E extends io.quarkus.hibernate.orm.panache.PanacheEntity>
extends Object
Abstract Class that contains boilerplate code to implement fundamental assembly operations
- Author:
- Trajy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract E
Override this method with implementation to assembly Data Transfer Object (DTO) type into Entity typeabstract D
Override this method with implementation to assembly Entity type into Data Transfer Object (DTO) typeassemblyUpdate
(E attached, E detached) Use strategy design pattern to fill entity attached with new dataabstract void
fillToAttachedEntity
(E attached, E detached) Override this method to copy new data from UPDATE request to attached on database object entity
-
Constructor Details
-
AbstractPanacheAssembly
public AbstractPanacheAssembly()
-
-
Method Details
-
assembly
Override this method with implementation to assembly Data Transfer Object (DTO) type into Entity type- Parameters:
d
- Data Transfer Object (DTO)- Returns:
- Entity filled with same DTO data
-
assembly
Override this method with implementation to assembly Entity type into Data Transfer Object (DTO) type- Parameters:
e
- Entity object- Returns:
- Data Transfer Object (DTO) filled with same Entity data
-
assemblyUpdate
Use strategy design pattern to fill entity attached with new data- Parameters:
attached
- object attached in databasedetached
- object detached with new data to persist- Returns:
- Entity attached into database
-
fillToAttachedEntity
Override this method to copy new data from UPDATE request to attached on database object entity- Parameters:
attached
- Entity atteched that will receive new Datadetached
- Entity detached that contains new data
-