Tell me, please, what is better to choose, Spring or Hibernate ?
Closed due to the fact that it is necessary to reformulate the question so that the participants can give an objectively correct answer Vladimir Martyanov , zRrr , Nicolas Chabanovsky ♦ 17 May '16 at 18:43 .
The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .
- It depends on what you need. Usually they are used together, because they have different tasks and one complements the other. - Sergey
2 answers
These are two different tools for different tasks. Hibernate is a powerful and at the same time cumbersome ORM framework that allows you to work with the database. Spring - a framework that includes many different features, DI, AOP, MVC, Security, etc. There is a Spring JDBC with its JdbcTemplate for working with the database.
If you are exactly in the key to working with the database, Hibernate or Spring JDBC, then what is more convenient for you depends on the task. This is an eternal holivar in fact for all projects that use to work with the base.
If you are just in the key frameworks as a whole, then they can perfectly complement each other within the framework of the whole project.
So these are different things. Spring is a framework or simplified development environment that includes many different modules. Hibernate is an implementation of the JPA specification. You can use both in one project and these things are not related to each other.