two-clock / backend

개발자를 위한 Github 계정 및 저장소 정보 공유 서비스
4 stars 0 forks source link

refactor: Refactor BoardDetail fetching and constructors #117

Closed openmpy closed 1 month ago

openmpy commented 1 month ago

관련 이슈

변경 사항

수정 전

Hibernate: 
    select
        b1_0.id,
        b1_0.category,
        b1_0.content,
        b1_0.created_date_time,
        b1_0.is_view,
        b1_0.member_id,
        b1_0.modified_date_time,
        b1_0.nickname,
        b1_0.title,
        b1_0.view_count 
    from
        board b1_0 
    where
        b1_0.id=? 
        and (
            b1_0.is_view = 1
        )
Hibernate: 
    select
        l1_0.board_id,
        l1_0.id,
        l1_0.created_date_time,
        l1_0.member_id 
    from
        likes l1_0 
    where
        l1_0.board_id=?
Hibernate: 
    select
        m1_0.id,
        m1_0.avatar_url,
        m1_0.created_date_time,
        m1_0.git_hub_id,
        m1_0.login,
        m1_0.modified_date_time,
        m1_0.name,
        m1_0.role 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        bf1_0.board_id,
        bf1_0.id,
        bf1_0.created_date_time,
        bf1_0.file_url,
        bf1_0.modified_date_time,
        bf1_0.original_name 
    from
        board_file bf1_0 
    where
        bf1_0.board_id=?

수정 후

Hibernate: 
    select
        b1_0.id,
        b1_0.category,
        b1_0.content,
        b1_0.created_date_time,
        fl1_0.board_id,
        fl1_0.id,
        fl1_0.created_date_time,
        fl1_0.file_url,
        fl1_0.modified_date_time,
        fl1_0.original_name,
        b1_0.is_view,
        ll1_0.board_id,
        ll1_0.id,
        ll1_0.created_date_time,
        ll1_0.member_id,
        b1_0.member_id,
        m1_0.id,
        m1_0.avatar_url,
        m1_0.created_date_time,
        m1_0.git_hub_id,
        m1_0.login,
        m1_0.modified_date_time,
        m1_0.name,
        m1_0.role,
        b1_0.modified_date_time,
        b1_0.nickname,
        b1_0.title,
        b1_0.view_count 
    from
        board b1_0 
    join
        member m1_0 
            on m1_0.id=b1_0.member_id 
    left join
        board_file fl1_0 
            on b1_0.id=fl1_0.board_id 
    left join
        likes ll1_0 
            on b1_0.id=ll1_0.board_id 
    where
        (
            b1_0.is_view = 1
        ) 
        and b1_0.id=?

체크 목록