Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You may have noticed that regardless of whether you use SQLData or ORAData, the code generated by JPublisher suffers from what many would justifiably consider a serious drawback. The problem is that the custom classes (which are domain objects—that is, objects that represent end-user business entities such as an Address, a Person, and so on) are tightly coupled with the persistence mechanism. For example, the getAddress() method in the generated domain class MyAddressAuto executes the method get_address() to retrieve the data from the database.
Even if database independence is not a goal of your design, it is a good coding practice to separate out the persistence mechanism that you use to save and retrieve your domain objects from the domain objects themselves. This is a fairly involved topic in its own right, and it’s beyond the scope of this book. Many well-documented frameworks (such as the Spring framework) are available, using which this objective can be achieved.