Architecture Pitfalls: Don’t use your ORM entities for everything — embrace the SQL!
Black Parrot Labs Blog: When designing an application with JPA/Hibernate, I’ve encountered a common pattern that suggests developers should channel as many of their interactions as possible with their database via their persistence entities and ORM, avoiding writing SQL at all costs. This mostly seems to stem from a belief that this approach will maximise model flexibility and database portability. Sometimes it's also an aversion to learning SQL. There’s a grain of truth to the portability argument, but in practice, the downsides of restricting yourself so significantly is usually a bad decision for a few reasons that I'll outline in this post.
blackparrotlabs.io