Skip to content

Commit

Permalink
fix: 테이블명 대문자로 조회되는 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
inpink committed Sep 30, 2024
1 parent a4757ea commit fd64b20
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import knusearch.clear.jpa.domain.post.BasePost;
import knusearch.clear.jpa.repository.post.BasePostRepository;
import knusearch.clear.jpa.repository.post.TermRepository;
import knusearch.clear.jpa.service.post.BM25Service;
import knusearch.clear.jpa.service.post.BasePostService;
import lombok.RequiredArgsConstructor;
Expand All @@ -27,6 +28,13 @@ public class BM25Controller {

private final BM25Service bm25Service;
private final BasePostRepository basePostRepository;
private final TermRepository termRepository;

@GetMapping("/testest")
public ResponseEntity<String> test() {
termRepository.findByNameIn(List.of("test"));
return ResponseEntity.ok("test");
}

@GetMapping("/makeInversedIndex")
public ResponseEntity<String> createPost() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/knusearch/clear/jpa/domain/post/Term.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import lombok.Getter;
import lombok.Setter;

@Entity(name = "term")
@Entity
@Table(indexes = {
@Index(name = "idx_term", columnList = "name")
}, name = "term")
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ spring:
jpa:
hibernate:
ddl-auto: update #update:프로젝트 재시작할떄마다 DB 초기화(create)되는것이 아닌 업데이트(코드의 변경사항를 DB에 업데이트) => validate(현재 코드가 DB 스키마와 일치하는지 검증해서 일치하면 시작)
naming:
implicit-strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

properties:
hibernate:
#dialect: org.hibernate.dialect.MySQLDialect
# show_sql: true
show_sql: true
# format_sql: true
jdbc:
batch_size: 50
Expand Down

0 comments on commit fd64b20

Please sign in to comment.