I have a hibernate entity Type like so
@Entity
@Table(name = "type")
public class Type {
@Column(name = "enabled")
private boolean enabled = false;
}
and I want to create a function that returns if any row in the Type table has enabled = true. I want to be as efficient as possible by using a projection or criterion but I don't know where to start