For what I see in this code, we're converting the dto to an entity just to delete the entity, maybe it would be a good idea to provide a deleteById method, or figure out another way of doing the deletion.
|
default void delete(S entity) { |
|
T persistentEntity = convertTo(entity); |
|
EntityManager em = getEntityManager(); |
|
persistentEntity = em.getReference(getPersistentClass(), persistentEntity.getId()); |
|
em.remove(persistentEntity); |
For what I see in this code, we're converting the dto to an entity just to delete the entity, maybe it would be a good idea to provide a deleteById method, or figure out another way of doing the deletion.
backend-core/backend-core-data-impl/src/main/java/com/flowingcode/backendcore/dao/jpa/ConversionJpaDaoSupport.java
Lines 85 to 89 in 6c23b71