In some cases, itβs very important not to use a full-blown ORM, but to rely on a lower level of abstraction, such as Spring JDBCTemplate and RowMapper. iBatis also comes to mind. And it makes sense even in large corporate solutions.
If you leave the whole world of ORM, you will have to do the extra work yourself. For example, you can write a SQL query with a connection, returning all client fields and all products of this client and iterating over it to match all this with a Java object. In quite a few cases, the code may be as clean as yours with ORM.
Writing all this data is more random, especially if you need to optimize material that has not been contaminated.
The best use case I can think of is batch processing, where control over data access is becoming more important, and a higher level of abstraction does not necessarily make you more productive.
source share