What an ORM does
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
list what an ORM automates and what it costs.
Planned topics
- ORM (object-relational mapper) maps classes to tables and generates SQL for you.
- It automates: insert/update/delete/select statements, row-to-object conversion, id handling, and change tracking.
- It costs: hidden SQL, surprise queries, a learning curve, and a performance model you must understand.
- It does not remove the need to know SQL; you still design tables and read the generated statements.
- JPA is the Java standard (a specification); Hibernate is the common implementation.
Draft outline details
Demonstration
Product p = em.find(Product.class, 42L); // select ... where id = 42
p.setPrice(new BigDecimal("9.99")); // no SQL yet; update is generated laterCheck your understanding
Is JPA a library or a specification?
Show answer
A specification; Hibernate implements it.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.