목차

Spring Data JDBC

가장 큰 특징

JdbcAggregateTemplate

EntityCallback

AbstractJdbcConfiguration

Bidirectional Relationship

internal

external

Caching

Eager Loading

class MinionView extends Minion {
    MinionView(String name, AggregateReference<Person, Long> evilMaster) {
        super(name, evilMaster);
    }
 
    @Embedded(onEmpty = Embedded.OnEmpty.USE_EMPTY, prefix = "master_")
    Person master;
}
 
// join 해서 MinionView에 값을 넣는 Repository 쿼리
@Query("select m.id as id, m.name name, m.number_of_eyes as number_of_eyes, " +
        "p.name as master_name, p.id as master_evil_master " +
        "from minion m join person p on p.id = m.evil_master")
List<MinionView> allMinionViews();

참조