Hibernate makes it easy to create a supported level of data access.
Hibernate is built on top of JDBC, so obviously it cannot do anything that simple JDBC cannot do. Hibernate - a large code base; if you create your own level of data access using simple JDBC, you will have much more code to write in accordance with your functions. In simple reporting applications, it is relatively easy to code the functions you need for the data access layer; but as the application becomes more complex, the amount of code that needs to be written increases. Let me give you a few examples that are not trivial to implement manually, but out of the box with Hibernate:
- Providing Global Streamlining Registration Lock
- Determining which fields of an object have been changed and customized the request accordingly (maybe this is not always a good idea)
- The flexibility to switch between different sampling strategies ("here I want the user and address to be loaded together, but here I just want only the user") in different cases
As I hinted, implementing them manually is not impossible - after that, Hibernate does this. But they make significant investments on time. In many (most?) Applications, focusing on the complexities of business logic would be the best investment of developers' time.
See my comment in another thread regarding Hibernate performance.
source share