Hibernate: Add a property in my class that is not mapped to a db-table
Solution 1:
Use @Transient
annotation for field you are not going to store in DB:
@Transient
public String getStatus() {
return status;
}
or:
@Transient
private String status;
Solution 2:
Mark it as @Transient
, and it won't be part of the DB schema.
Solution 3:
If you annotate a field with @Transient
it will not be persisted.