それらが私の実体であるとしましょう:
Table1.java
@Entity
public class Table1 {
// Many to one
private Table2 table2;
// Raw attributes
// ...
}
Table2.java
@Entity
public class Table2 {
// Many to one
private Table3 table3;
// Raw attributes
// ...
}
Table3.java
@Entity
public class Table3 {
// Raw attributes
private String lang; // "fr", "en", "de"...
}
に等しいTable1
aを持つすべての行をリストしたいと思います。例でクエリを使用しようとしました:table2.table3.lang
en
Table3 table3Example = new Table3();
table3Example.setLang("en");
Table2 table2Example = new Table2();
table2Example.setTable3(table3Example);
Table1 table1Example = new Table1();
table1Example.setTable2(table2Example);
table1Repository.findByExample(table1Example);
問題は、.findByExample(table1Example)
に関係なく、データベースのすべての行を返すことですlang
。これは、フィルターがまったく考慮されないことを意味します。:(
どんな助けでもいただければ幸いです:)
PS:例外はスローされず、すべての行.findByExample(table1Example)
を返すだけです。Table1