Answer the question
In order to leave comments, you need to log in
How to filter out duplicate values in Hibernate?
There is a table that I need to filter in such a way that the values of one of the columns never repeat.
Looks like I completely forgot how to google, but on the net they always refer to Projections.distinct(), which returns not the entire table, but only the filtered column.
Help me figure it out, or am I configuring this class incorrectly, or should I use something else?
Answer the question
In order to leave comments, you need to log in
@Entity
@Table(name="values")
class MyEntity {
...
@Column(unique=true)
private String myValue;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question