I have an entity with a flag, like:
@Entity
Class User{
@Column
private String name;
@Column
private Boolean excluded;
// Getters, setters
}
I need to keep the excluded users on DB, but I really never retrieve it.
Is there a way to tell hibernate "do not get if excluded=1" without having to specify it in every single query I do with this entity?
(I simplified the problem to ask here, but the query I need to do is a lot bigger because of this flag restriction. If I could annotate the column to be mandatory =true when retrieving from DB, would be great)