I have parent/child relationship between two tables, and the corresponding mapping in my Java classes. The tables roughly look like that:
A (ref number, stuf
Another solution is to use Hibernate's @Where: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#pc-where
@OneToMany @JoinColumn(name = "A_REF", referencedName = "REF") @Where(clause = "other = 123") private Set bs;