read enough information about JDBC and ORM, now I would like to test your understanding of working with the database in Java and set a couple of questions regarding JDBC, JPA, ORM (Hibernate).
- jdbc This is an interface for working with SQL queries in Java.
- ORM This is also an interface that is built by the JPA specification and it has several implementations such as Hibernate, EclipseLink, etc. ORM works on the principle of mapping objects from Java to the tables and their columns in the database, all this makes it with the help of anatations, and ORM requests is itself
As I realized that the JDBC is that ORM make the same difference only difficulties and optimization for different projects, that is, it is sometimes profitable to use JDBC, and sometimes ORM.
Tell me please do I argue correctly?
No wrong arguing.
JDBC is a basis – ORM is an add-in over JDBC.
JDBC is a nails that can be told to say a stool, and ORM is an automatic gun that clog nails.
A programmer who writes on JDBC looks like a hardworker who scores nails with a hand hammer, slowly and stubbornly. If you are using ORM, it is already similar to a qualified worker who clogs nails with a pneumopistolet: quickly and reliably.
JDBC is a means of working with a database from Java.
Hibernate (and JPA) – Designed to separate work in Java from work in the database. At the same time, the programmer works in Java, implements business rules, and synchronization questions from the database entrustes Hibernate. The programmer writes to Java using the sublime abstractions of the OOP (in particular inheritance), and Hibernate, in accordance with the settings and mappings (which can also create Hibernate) produces synchronization and tightening objects on demand. It is assumed that the programmer does not write requests for SELECT, INSERT, DELETE, UPDATE (although such an opportunity and is provided) and SpringData further enhances this opportunity. For example, a programmer in Java requests an object of the object and its ID through the HiberNate, changes the fields of this object and then requests the synchronization of this object with the database. Hibernate himself understands how to write SELECT and how to write update.
Hibernate is relational storage (Java objects) for Java Ideomatics.
Spring Data JDBC – manage the appeals to the database. Knowledge requires
Spring Data JPA – simplifies access to database with Java. Knowledge
SQL is not required, but can be useful.