I have two object like this
public class Foo {
//something
@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "tid")
Set<Bar> barSet;
}
public class Bar {
//I don't use many-to-one here
}
when I query Foo using HQL look like this:
FROM Foo f JOIN FETCH f.barSet
I have the amount of duplicated records exactly the same as the amount of Bar's records. How can I fix that?
Thanks a lot!