For design reasons, the relationship between my entities is as follows: Having entities A, B, C and AB where AB is the relationship many to many. I want to index the values of the entity C that has a many to many relationship with the B, starting from the relationship with A. I have a postgresql relational database and I am trying to map to elasticsearch but I can not find a way to do this and handle the relations may to many. Thanks in advance.
@Entity
public class A {
...
@OneToMany(mappedBy = "a", cascade = CascadeType.ALL)
private List<AB> b;
}
@Entity
public class AB {
...
@ManyToOne
B b;
}
@Entity
public class B {
...
@ManyToMany
private List<C> c;
}
@Entity
public class C {
... // I want this indexes!!!
@ManyToMany(mappedBy = "c")
private List<B> b;
}