Connecting to SQL Databases Using ORM Frameworks

The Vaadin Framework is a web framework—a library, if you wish, that helps with web development. You, as a developer, have the opportunity to integrate it with any other Java technology, and in particular, with any persistence technology. Since the most popular technology for persisting data is SQL, this chapter is dedicated to exploring several alternatives to connecting to SQL databases from Vaadin applications.

We will start by studying the concept of object-relational mapping, a technique that allows developers to use an object-oriented programming language to consume and manipulate data in an otherwise incompatible system. We'll then move on to explore three of the most popular Java frameworks used to connect to SQL databases: JPA, MyBatis, and jOOQ. These technologies are widely used in the industry, and it's important that you understand at least the philosophy and fundamentals of each one in order to select the best options for your projects.

Throughout the sections in this chapter, we will develop very simple web UIs that list data from a database (using the Grid class), and present a simple form to add data to it. The purpose of the examples is to show you the very fundamentals of data binding with Vaadin. The next chapter will focus on more advanced data binding to develop sophisticated CRUD (Create, Read, Update, and Delete) user interfaces.

This chapter covers the following topics:

  • Object-relational mapping (ORM) frameworks
  • Java Persistence API (JPA)
  • MyBatis
  • Java Object Oriented Querying (jOOQ)
..................Content has been hidden....................

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