on-internet
← Community

Hibernate @Where annotation on a ManyToOne relation

Stack Overflow ·

I have recently started to refactor my project because I had to add an extra column to some of my table. The extra column is an Enum (Pending, or Active). Because of that change I would need now to refactor ALL my queries to only retrieves a row if the status is ACTIVE. After some research I found that we can annotate an Entity with the @Where annotation. it works fine where I use it on a simple column but my table look like this: @Where(clause = 'state='ACTIVE'") @Entity public class Place { @Column(name="id_place") private String placeId; @Column(name="name") private String palceName; @OneTo

Comments

Sign in or sign up to comment and upvote.

No comments yet.