Kotlin with JPA and EJB

Data persistence is an important aspect in an enterprise application. Almost all businesses are data driven. Persisting this data, retrieving it, and processing it in order to make business decisions are common activities in an enterprise application:

The component that deals with data persistence and data retrieval is popularly known as the object-relational mapping (ORM) component. Persistence frameworks also offer ORM layers of abstraction between the application and the database. The persistence framework is responsible for converting the state of objects to entities, persisting them to a relational database, and retrieving them for processing purposes.

Java EE has an API that can be used in the ORM component of an application. This is called the Java Persistence API (JPA). This is one of the most important APIs in Java EE and the solution that Java EE uses to talk to relational databases and non-relational databases.

The following topics will be covered in this chapter:

  • Data classes in Kotlin
  • An introduction to JPA and its architecture
  • Mapping domain entities to database tables
  • Writing queries for data retrieval
  • Mapping the relations between the entities
  • Defining the data source and the persistence context
  • JPA transactions
  • Exception handling
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset