Refactoring the Java classes

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.

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 ...

Get Enterprise Application Development with Ext JS and Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.