The classes generated by the reverse engineering process can be improved upon with a little refactoring to make the code more readable and easier to understand. Some of the autogenerated properties and fields have id
in their name when we are actually referring to classes, while the collection of java.util.List
objects have list
in their name. Let's start with the Company.java
file.
This file represents the Company
entity. Double-click on the file to open it in the editor and browse through the contents. This class is a simple POJO with set and get methods for each property in addition to the standard hashCode
, equals
, and toString
methods. The class has a no-arg constructor (required by the JPA specification as domain objects must be created dynamically without any properties), a second constructor that takes only the primary key, and a full (all arguments) constructor. We will make the code more readable by making a few minor changes to...