S2JDBCの1対多の結合はなんでinnerJoinなんやろ?
S2JDBCのTutorialでDepartmentのエンティティにOneToManyでEmployeeのエンティティが指定されています。
@Entity
public class Department {
...
@OneToMany(mappedBy = "department")
public ListemployeeList;
}
というEntityに対して
Listresults =
jdbcManager
.from(Department.class)
.getResultList();
だとemployeeListはNULLになるんですが、
Listresults =
jdbcManager
.from(Department.class)
.innerJoin("employeeList")
.getResultList();
ではemployeeListにEmployeeが設定されています。
最初これがわからずに色々と調べてしまった。
取得できるのは良いんですが、なんでinnerJoinなんだろ。
わかったからいいや。