Skip to content

Commit

Permalink
Merge pull request #199 from twenty-three-23/feature/TT-237
Browse files Browse the repository at this point in the history
!TT-237 메이저 스크립트 조회 불가
  • Loading branch information
snacktime81 authored Jul 12, 2024
2 parents 625677c + cd7ba44 commit 4b6c36f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class ScriptEntity extends BaseCreatedAtEntity {
@OneToOne
@JoinColumns(value = {
@JoinColumn(name = "major_version", referencedColumnName = "major_version"),
@JoinColumn(name = "minor_version", referencedColumnName = "minor_version")
@JoinColumn(name = "minor_version", referencedColumnName = "minor_version"),
@JoinColumn(name = "theme_id", referencedColumnName = "theme_id")
})
private VersionEntity version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public static SentenceEntity ofCreateInputSentence(ScriptEntity scriptEntity,
if(scriptEntity.getDType() != InputAndSttType.INPUT) {
throw new IllegalArgumentException("팩토리얼 함수를 잘못 사용했습니다.");
}
log.info("여기까지는 됨 {}", paragraphId);
return new SentenceEntity(scriptEntity, paragraphId, sentenceContent, sentenceOrder, sentenceExpectTime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ public interface ScriptRepository extends JpaRepository<ScriptEntity, Long> {

@Query("select s from ScriptEntity s " +
"join fetch VersionEntity v " +
"on s.version.majorVersion = v.majorVersion and s.version.minorVersion = v.minorVersion " +
"where v.ThemeEntity.themeId = :themeId " +
"and v.minorVersion = 0")
"on s.version.majorVersion = v.majorVersion and s.version.minorVersion = v.minorVersion and s.version.ThemeEntity.themeId = v.ThemeEntity.themeId " +
"where v.minorVersion = 0")
List<ScriptEntity> findMajorScriptByThemeId(Long themeId);

@Query("select s from ScriptEntity s " +
Expand Down

0 comments on commit 4b6c36f

Please sign in to comment.