Package br.com.trajy.architecture.base
Class AbstractPanacheService<E extends io.quarkus.hibernate.orm.panache.PanacheEntity>
java.lang.Object
br.com.trajy.architecture.base.AbstractPanacheService<E>
- Type Parameters:
E
- Entity type
public abstract class AbstractPanacheService<E extends io.quarkus.hibernate.orm.panache.PanacheEntity>
extends Object
Abstract Class that contains boilerplate code to implement find, create, update and delete operations with your
respective business rules using Hibernate panache entity reactive
- Author:
- Trajy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterDelete
(Long id) Override this method to handle business logic after delete featureprotected void
Override this method to handle business logic after find featureprotected void
afterFindById
(E e) Override this method to handle business logic after find by id featureprotected void
afterUpdate
(Long id, E e) Override this method to handle business logic after update featureprotected void
beforeCreate
(E e) Override this method to handle business logic before create featureprotected void
beforeDelete
(Long id) Override this method to handle business logic before delete featureprotected void
Override this method to handle business logic before find featureprotected void
beforeFindById
(Long id) Override this method to handle business logic before find by id featureprotected void
beforeUpdate
(Long id, E e) Override this method to handle business logic before update featurevoid
Boilerplate code implementation to handle create featurevoid
Boilerplate code implementation to handle delete featureprotected abstract void
Override this method to call static implementation of delete method from Entity that extends PanacheEntityfind()
Boilerplate code implementation to handle find featureBoilerplate code implementation to handle find by id featureprotected abstract E
Override this method to call static implementation of find by id method from Entity that extends PanacheEntityOverride this method to call static implementation of find method from Entity that extends PanacheEntityvoid
Boilerplate code implementation to handle update feature
-
Constructor Details
-
AbstractPanacheService
public AbstractPanacheService()
-
-
Method Details
-
find
Boilerplate code implementation to handle find feature- Returns:
- found results
-
findById
Boilerplate code implementation to handle find by id feature- Parameters:
id
- id to search- Returns:
- found entity
-
create
Boilerplate code implementation to handle create feature- Parameters:
e
- entity with data to persist
-
update
Boilerplate code implementation to handle update feature- Parameters:
id
- id of object to updatee
- entity with data to update
-
delete
Boilerplate code implementation to handle delete feature- Parameters:
id
- id to delete
-
findStaticMethod
Override this method to call static implementation of find method from Entity that extends PanacheEntity- Returns:
- results from static implementation
-
findByIdStatidMethod
Override this method to call static implementation of find by id method from Entity that extends PanacheEntity- Parameters:
id
- id to search- Returns:
- result from static implementation
-
deleteByIdStaticMethod
Override this method to call static implementation of delete method from Entity that extends PanacheEntity- Parameters:
id
- id to delete
-
beforeFind
protected void beforeFind()Override this method to handle business logic before find feature -
afterFind
Override this method to handle business logic after find feature- Parameters:
es
- found entities
-
beforeFindById
Override this method to handle business logic before find by id feature- Parameters:
id
- id that will be searched
-
afterFindById
Override this method to handle business logic after find by id feature- Parameters:
e
- found entity
-
beforeCreate
Override this method to handle business logic before create feature- Parameters:
e
- entity that will be persisted
-
beforeUpdate
Override this method to handle business logic before update feature- Parameters:
id
- id that will be updatede
- entity with new data to update
-
afterUpdate
Override this method to handle business logic after update feature- Parameters:
id
- id that has searchede
- entity that has persisted
-
beforeDelete
Override this method to handle business logic before delete feature- Parameters:
id
- id ta will be deleted
-
afterDelete
Override this method to handle business logic after delete feature- Parameters:
id
- id that has deleted
-