79088811

Date: 2024-10-15 07:29:10
Score: 1.5
Natty:
Report link

As others mentioned there are a few solutions,

Using @Query

@Query(value = "from Pharmacy where id = :id")
Optional<Pharmacy> findById(Long id);

The one that probably takes the least to implement is

Optional<Pharmacy> findOneById(Long pharmacyId);

since findOneById is not part of Jpa it doesn't call EntityManager.find and filters are correctly applied.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @QueryThe
  • Low reputation (1):
Posted by: Dragan Jovanovic