Coder Social home page Coder Social logo

java-mod-6-jpa-and-hibernate-intro's Introduction

What is JPA and Hibernate?

Learning Goals

  • Define the Jakarta Persistence API (JPA) specification.
  • Introduce Hibernate as a JPA implementation.

Introduction

The Jakarta Persistence API (JPA) is a standard specification that defines how an ORM should interact with a database. It was introduced so that a common interface could be used across different ORM solutions.

In JPA, we define persistence rules based on Java classes and objects. This is different that JDBC, which requires us to manually translate from Java classes to relational tables and back again.

The JPA Standard

The JPA standard has three main parts:

  • The API: The API specifies methods for interacting with the ORM provider. It’s located in the jakarta.persistence package.
  • JPQL: The Java Persistence Query Language (JPQL) is a query language that can be used to make data requests with objects.
  • Metadata: Annotations are used to define a mapping between objects and a data store. For example, the @Entity annotation is used to indicate that a Java class represents a single table in a relational database. The fields in the class represents the columns in the table.

What is Hibernate?

The JPA defines a specification for interacting with a database but it doesn’t provide any concrete implementations for managing objects. The JPA interfaces are implemented by different providers who define how exactly the objects are managed.

Hibernate is one of the most popular implementations of JPA. It is highly performant, reliable, extensible, and a complete implementation of JPA. It has a large community because of its popularity which makes it easier to find possible solutions.

Conclusion

JPA which is a specification that provides standards for mapping objects to a database. Hibernate is one of the most popular implementations of the JPA standard. In the next few lessons, we will learn how to set up Hibernate and create objects to persist in a database.

Resources

java-mod-6-jpa-and-hibernate-intro's People

Contributors

alveem avatar linda-seiter avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

connereg crives

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.