I have a class which I don't want it to be stored on the database, basically it is used for receiving such info from a http request.
class Address {
private String address;
private String postCode;
// + getters and setters
}
Bear in mind that this class is not an entity. Now I'd like to create an entity by inheriting from it.
@Entity
class StorableAddress extends Address {
// id and a few more fields.
}
When I save a StorableAddress it doesn't save any field from Address (address and postCode). Is there a solution for that or do I have to copy all the fields?