I am trying to learn JPA. I created a simple entity class. This object has 3 columns: ID, NAME, NUMBER_A. It works great: I can save, update and delete without problems.
What I'm trying to do is create a calculated / computed column. I want to get NUMBER_A, use it to compute a new value and set the computed column (say, CALC_COLUMN).
This calculated column will not be saved. This is only necessary at runtime.
I tried to create a simple double object and its getter and setter, but when I run the application, it gives an error message indicating that the CALC_COLUMN column does not exist because JPA / EclipseLink is trying to use it as a valid database column (Column "CALC_COLUMN" either not in any table in the FROM list ...).
So can this be done?
TIA, Bob
source
share