Menu

JPA and Hibernate for Dummies
πŸ“°

JPA and Hibernate for Dummies

DEV Community: javaΒ·Carsten BehrensΒ·16 days ago
#ss8F8KZT
#devtojava#devto#dev#hibernate#java
Reading 0:00
15s threshold

When working with Java you'll eventually come across the terms JPA (Java Persistence API) and Hibernate .

TLDR

JPA (Java Persistence API) is a specification β€” a set of interfaces and annotations that describes what an ORM tool should do.

Hibernate is the most popular implementation of that specification.

You write your code against the JPA interfaces. Hibernate (or another provider) does the actual work under the hood.

JPA (Java Persistence API) aka Jakarta Persistence

JPA is a Java specification that describes what an ORM (Object-Relational Mapping) tool should do.

It was renamed to Jakarta Persistence in 2019 due to trademark restrictions. (Hello Oracle πŸ‘‹)

It provides annotations like @Entity , @Id , @Table , and @Column that can be added to regular Java classes.

import jakarta.persistence.* ;

@Entity @Table ( name = "employees" ) public class Employee {

@Id @GeneratedValue ( strategy = GenerationType .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.