From Java EE 5 onward, the Java Persistence API (JPA) allows us to persist and retrieve objects from databases. JPA provides an object/relational mapping tool that maps between Java objects and SQL statements. With JPA, therefore, it is not necessary to execute a number of PreparedStatement
against the database Connection
objects to get a ResultSet
back from the database, like was necessary with JDBC. Additionally, as JPA abstracts developers away from SQL statements, we no longer have to worry about different "flavors" of SQL. For example, with JPA, we are generally removed from the problem of "how do we create auto-incrementing fields with Oracle/SQL Server/MySQL".
In this chapter, we're not going to explain all the different concepts of JPA; we will assume that you have some familiarity with it. The aim of this chapter is not to introduce or teach JPA, but to show how NetBeans aids developers who are handling relational data. We will concentrate on how NetBeans enhances...