Is it possible for a JPA entity to have a field which is not mapped to any column in the data base table. Basically I need to store some additional data on my front end but I do not want to create an extra column in the table for this. Right now if I just add the field to the JPA entity like this...
this is not a good practice to use the Entity as view Object. will suggest you to have them separately as Objects fetched from database will be attached entities.
Joined: Apr 30, 2002
Thank you for your response.
I tried what you said but it still is not working. First I tried putting the transient annotation above the getter, then I put it above the field and the getter, and both times it gives the same error...
It seems to be happening when it is running a query, meaning it is putting this extra field in the query. Does transient also prevent the field from being included in queries...