묻고 답해요
141만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
2023.08.10 기준 Spring Boot 3버전 대 Security Config 설정 파일 공유합니다.
@Configuration @EnableWebSecurity @RequiredArgsConstructor public class WebSecurity { private final UserService userService; private final BCryptPasswordEncoder bCryptPasswordEncoder; private final Environment environment; @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.csrf(AbstractHttpConfigurer::disable) .authorizeHttpRequests(request ->{ request.requestMatchers(antMatcher("/actuator/**")).permitAll(); request.requestMatchers(antMatcher("/**")).permitAll();}) // .headers(header -> header.frameOptions( // frameOptionsConfig -> frameOptionsConfig.disable())) .apply(new MyCustomSecurity()); return http.build(); } public class MyCustomSecurity extends AbstractHttpConfigurer<MyCustomSecurity, HttpSecurity> { @Override public void configure(HttpSecurity http) throws Exception { AuthenticationManager authenticationManager = http.getSharedObject( AuthenticationManager.class); AuthenticationFilter authenticationFilter = new AuthenticationFilter(authenticationManager, userService, environment); http.addFilter(authenticationFilter); } protected void configure2(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userService).passwordEncoder(bCryptPasswordEncoder); } } }해당 코드는 앞 내용까지 포함하여 설정이 적용된 버전입니다. 저같은 경우는 처음부터 mysql로 진행하여서 h2 콘솔을 사용하지 않아 frameOptions를 주석처리 하였으나, 혹여나 h2 콘솔 사용하시는 분은 주석 해제 후 사용하시면 되고, 23.08.10 기준으로 hasIpAddress는 사용 불가능합니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
spring boot 3버전대에서 metrics에서 정보 안나오는 문제 해결
@Configuration @EnableAspectJAutoProxy public class MetricsConfig { @Bean public TimedAspect timedAspect(MeterRegistry registry) { return new TimedAspect(registry); } }해당 config 파일을 추가해주세요.
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
[해결완료] 로그인 인증 테스트코드 작성 질문입니다
안녕하세요 호돌맨 선생님!세션토큰 발급기능 추가를 초반에 보다가 로그인 관련 테스트를 직접 작성해보라고 하셔서 해봤는데 궁금한 점이 있어서 질문드립니다!작성한코드@Test @DisplayName("인증 테스트") void test11() throws Exception { // given Member member = Member.builder() .email("abc@naver.com") .password("1234") .build(); // UserRepository를 MemeberRepository로 이름 변경 했습니다. memberRepository.save(member); Login login = Login.builder() .email("abc@naver.com") .password("1234") .build(); String json = objectMapper.writeValueAsString(login); // expected mockMvc.perform(post("/auth/login") .contentType(APPLICATION_JSON) .content(json) ) .andExpect(status().isOk()) .andDo(print()); 결과query did not return a unique result: 2; nested exception is javax.persistence.NonUniqueResultException: query did not return a unique result: 2 원인JPA 에러라는 것을 검색을 통해서 알았습니다해결 방법 블로그 주소 : https://wakestand.tistory.com/943UserRepository에 작성한 findByEmailAndPassWord 메서드가 Optional로 되어 있는데 이 부분을 List로 변경해야할 것 같아서 다음과 같이 변경했습니다 변경된 코드UserRepositorypublic interface MemberRepository extends CrudRepository<Member, Long> { List<Member> findByEmailAndPassword(String email, String password); }AuthService@Service @RequiredArgsConstructor public class AuthService { private final MemberRepository memberRepository; public List<Member> signin(Login login) { List<Member> memberList = Optional.ofNullable(memberRepository.findByEmailAndPassword(login.getEmail(), login.getPassword())) .orElseThrow(() -> new InvalidSign()); return memberList; } } 위 처럼 Optional<Member가 아닌 List<Member>로 변경해서 테스트 로직을 성공하긴했습니다... 질문UserRepository의 Optional<Member>를 변경하지 않고 테스트 코드를 작성하는 방법이 있을까요??Optional에서 List로 변경했을 때 문제점은 없을까요?
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
Movie em.find JOIN 실행시 오류 발생
=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 강의 내용대로 Movie em.find를 통한 조회 부분을 진행하던 중 쿼리가 날라가지 않는 오류가 발생하여 질문 드립니다.비슷한 문제를 겪는 학생 분 답변 중, hibernate 버전을 5.3.13Final로 올려야 한다는 글을 봐서 그대로 버전을 올렸는데도 오류가 없어지지 않습니다..혹시 어디가 문제인지 알 수 있을까요? 구글 드라이브 주소 : https://drive.google.com/file/d/1BBVCl_O5PLSdoUeR0hKmRLG11j62oNhz/view?usp=sharing 오류 메세지ERROR: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.ITEM(ID) [1, STRINGDECODE('\ubc94\uc8c4\ub3c4\uc2dc'), 12000]"; SQL statement:/* insert hellojpa.Movie */ insert into Item (name, price, id) values (?, ?, ?) [23505-200]
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
h2 경로를 못바꾸겠어요
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)예3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.저번에 했을때 jdbc:h2:tcp://localhost/~/test 경로인데 이걸 못바꾸겠어요 새로운 경로로 다시만들고 싶은데 어떻게 바꾸는건지 시작화면에서 바꾸니깐 Database "C:/Users/ckehq/jpashop" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-220] 90149/90149 에러만 떠요...
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
window11 / 23.08.09 기준 kafka connect 버전
window11 / 23.08.09 기준으로 kafka connect 버전을 7.1 버전으로 사용하시길 바랍니다.해당 강의의 6.1 버전에서 properties 경로를 못찾아서 버전업을 했더니 해결 했습니다.
-
해결됨실전! Querydsl
DTO가 DTO를 가지고 있을 때의 Projections.bean() 혹은 @QueryProjection 사용에 대하여
안녕하세요 영한님공부한 내용을 복습할겸 호출한 외부 api의 데이터를 Projections.bean() 혹은 @QueryProjection을 이용하여 DTO로 바로 조회하여 저장하는 연습을 하고 있었습니다.DTO가 일반적인 객체타입이나 원시타입만 가지고 있었을 때에는 큰 상관이 없었으나 DTO가 DTO를 내부적으로 또 가지고 있으니 위의 방법으로는 오류가 발생하였습니다.DTO안에 DTO가 포함된 관계성은 api 제공 사이트측에서 정한것이라 이를 수정하지는 못했습니다.리포지토리와 2개의 DTO의 코드는 다음과 같습니다.@NoArgsConstructor @Getter @Setter public class MatchDTO { private InfoDTO info; @QueryProjection public MatchDTO(InfoDTO info) { this.info = info; } }@Getter @Setter public class InfoDTO { private Long gameDuration; private String gameMode; private List<ParticipantDTO> participants; }public class MatchQueryRepositoryImpl implements MatchQueryRepository { private final EntityManager em; private final JPAQueryFactory query; public MatchQueryRepositoryImpl(EntityManager em) { this.em = em; this.query = new JPAQueryFactory(em); } @Override public Page<MatchDTO> search(MatchSearchCond searchCond, Pageable pageable) { List<MatchDTO> content = query .select(new QMatchDTO(match.info)) .from(match) .where(gameDurationLoe(searchCond.getGameDuration())) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch(); return new PageImpl<>(content); } private BooleanExpression gameDurationLoe(Long gameDuration) { return gameDuration != null ? match.info.gameDuration.loe(gameDuration) : null; } }이렇게 코드를 설정하면 다음과 같은 컴파일 오류가 query.select()절에서 발생하였습니다.Required type: Expression<? extends practice.secondapi.dto.match.InfoDTO>Provided: QInfo 엔티티가 Q객체로 바뀌는 과정에서 타입 불일치가 일어난 듯 싶은데 구체적인 해결책은 잘 모르겠습니다 ㅠㅠ코드에 넣지는 않았지만 심지어 InfoDTO는 ParticipantDTO를 리스트로 가지고 있기도 해서... 어떻게 야매로 해결한다해도 또 같은 문제가 발생할 것 같아서 근본적인 원인과 해결책이 궁금합니다!
-
해결됨실전! 스프링 데이터 JPA
1:N 양방향 매핑시에 컬렉션 필드 초기화가 안되는 문제..
안녕하세요. 강의 코드를 참고하며 1:N 양방향 매핑을 시도하고 있습니다.다른 테이블에서는 성공적으로 해서 정말 다른거 없이 똑같이 매핑해서 테스트를 진행중이었는데정말 이유를 모르겠는게 객체가 생성되면서 멤버 변수가 초기화가 되어야 하는데 되지 않아 null값이 들어가있고.null 값이 들어간 List에 add를 하려고 하니 NullPointerException이 나고 있습니다.같은 로직, 같은 OneToMany 매핑을 한 다른 엔티티 에서는 잘 되었는데 해당 부분에서 어떤 이유로 생성될때 멤버변수가 초기화가 되지 않는지 도무지 잘 모르겠습니다.. 이유를 아시는분 도와주시면 정말 감사하겠습니다.정상적으로 진행된 매핑 및 코드는 아래와 같습니다.@Entity @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "dtype") @DiscriminatorValue("my") @Table(name="my_wallets") @Getter @Setter public class MyWallet { @Id @GeneratedValue @Column(name = "wallet_id") private Long id; private Integer balance=0; //cascade = Persist 속성을 명시해줌으로써, 영속성 전이를 사용하였음. //orphanRemoval = true 를 사용해서 고아 객체를 자동으로 제거 함. @OneToMany(mappedBy = "wallet", cascade = CascadeType.PERSIST,orphanRemoval = true) private List<Transactions> transactions = new ArrayList<>(); public void addTransactions(Transactions transaction){ this.transactions.add(transaction); transaction.setWallet(this); } ------------------------------------- @Entity @Table(name = "transactions") @Getter @Setter @ToString @AllArgsConstructor @NoArgsConstructor @Builder public class Transactions { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "transaction_id") private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "wallet_id") @Setter private MyWallet wallet; private Long counterId; private Timestamp transactionDate; private String transactionType; private Integer amount; private String location; private Integer balance; private Boolean success; } ----------------------테스트 부분 Transactions t = Transactions.builder() .amount(100) .balance(200) .success(Boolean.TRUE) .build(); MyWallet m1 = createMyWallet(); m1.addTransactions(t); em.persist(m1);컴파일 에러도 없고, 정상적으로 h2 db에 들어가는것을 확인 했습니다.그런데 같은 로직으로 진행한 연관관계 메서드에서 오류가 발생했습니다.문제가 되는 코드들은 아래와 같습니다. import lombok.*; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "article") @Getter @Setter @ToString @AllArgsConstructor @NoArgsConstructor @Builder public class Article { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "article_id") private Long id; private Long walletId; private Long imageId; @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "transaction_id") private Transactions transaction; @OneToMany(mappedBy = "article",cascade = CascadeType.PERSIST, orphanRemoval = true) private List<Comments> comments = new ArrayList<>(); // List<Commnets> comments = new ArrayList 를 해주었음에도 null이 들어가있음. public void addComment(Comments comment){ //따라서 null 에 add 를 하려고 하니 NullPointerException이 발생합니다.. comments.add(comment); comment.setArticle(this); } } import lombok.*; import javax.persistence.*; import java.sql.Timestamp; @Entity @Table(name = "comments") @Getter @ToString @AllArgsConstructor @NoArgsConstructor @Builder @Setter public class Comments { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "comment_id") private Long commentId; @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "article_id") @Setter private Article article; private Long writerId; private String content; private Timestamp postedDate; } 이 아래는 실행해봤던 테스트 코드중 발생하는 위치의 코드입니다.. Article article = Article.builder() .imageId(99L) .walletId(1L) .imageId(-99L) .build(); em.persist(article); Comments comment = Comments.builder().content("컨텐츠1").writerId(123L).build(); System.out.println("comment = " + comment.toString()); em.persist(comment); article.addComment(comment); //이 부분이 문제..persist를 안해줘서 그런가 싶어서 앞뒤로 옮기며 확인해봤는데 여전히 필드 초기화가 되지 않아서 정말 의문입니다 제가 기본적으로 무엇을 놓치고 있는걸까요 ㅠㅠ 테스트 코드에서 무언가 잘못했을까 싶어 전체 코드도 남겨봅니다. import lombok.RequiredArgsConstructor; import org.apache.tomcat.jni.Address; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import java.awt.print.Book; @Component @RequiredArgsConstructor public class initDb { private final InitService initService; @PostConstruct public void init() { initService.doInit1(); // initService.doInit2(); } @Component @Transactional @RequiredArgsConstructor static class InitService { private final EntityManager em; public void doInit1() { Transactions t = Transactions.builder() .amount(100) .balance(200) .success(Boolean.TRUE) .build(); MyWallet m1 = createMyWallet(); m1.addTransactions(t); em.persist(m1); MoimWallet moim = createMoimWallet(1000); em.persist(moim); System.out.println("2차 테스트"); moim.setBalance(100); //Mywallet으로 업 캐스팅 ok MyWallet moim2 = createMoimWallet(2000); em.persist(moim2); User user = new User(null, m1, 1L, "ansik_id", "1234", "안식_name", "981212-121212", "010111", UserType.Parent, null); // user.getUsername("안식씨"); em.persist(user); WalletsAndMember wam = new WalletsAndMember(null, moim, user); em.persist(wam); WalletsAndMember wam2 = new WalletsAndMember(null, (MoimWallet) moim2, user); em.persist(wam2); Article article = Article.builder() .imageId(99L) .walletId(1L) .imageId(-99L) .build(); em.persist(article); Comments comment = Comments.builder().content("컨텐츠1").writerId(123L).build(); System.out.println("comment = " + comment.toString()); em.persist(comment); System.out.println("comment = " + comment.toString()); // comment.setArticle(article); article.addComment(comment); // article.getComments().add(comment); em.persist(article); em.flush(); em.clear(); } private static MyWallet createMyWallet() { MyWallet myWallet = new MyWallet(); return myWallet; } private static MoimWallet createMoimWallet(int amount) { MoimWallet moimWallet = new MoimWallet(); moimWallet.setTarget_amount(amount); return moimWallet; } } } 아래에 에러 로그를 남겨봅니다Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-08-10 00:59:32.985 ERROR 47056 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initDb': Invocation of init method failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.28.jar:5.3.28] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.13.jar:2.7.13] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.13.jar:2.7.13] at team.ServerApplication.main(ServerApplication.java:12) ~[classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-2.7.13.jar:2.7.13] Caused by: java.lang.NullPointerException: null at team.entities.Article.addComment(Article.java:33) ~[classes/:na] at team.initDb$InitService.doInit1(initDb.java:74) ~[classes/:na] at team.initDb$InitService$$FastClassBySpringCGLIB$$48d5c178.invoke(<generated>) ~[classes/:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.28.jar:5.3.28] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.28.jar:5.3.28] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.28.jar:5.3.28] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.28.jar:5.3.28] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.28.jar:5.3.28] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.28.jar:5.3.28] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.28.jar:5.3.28] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.28.jar:5.3.28] at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.28.jar:5.3.28] at team.initDb$InitService$$EnhancerBySpringCGLIB$$3cdef9a7.doInit1(<generated>) ~[classes/:na] at team.initDb.init(initDb.java:22) ~[classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.28.jar:5.3.28] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.28.jar:5.3.28] ... 23 common frames omitted Process finished with exit code 1
-
해결됨Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
docker mysql or mariadb 실행 에러 참고하세요
mariadb 최신버전 사용시 Dockerfile 그대로 작성시 실행 에러가 발생합니다.저는 sql 을 백업해서 스키마랑 테이블 새로 만들도록 수정해서 해결했습니다.추가로 실행후 mysql 접속도 mysql 명령어가 아닌 mariadb 로 작성하셔야 됩니다.mariadb -h127.0.0.1 -uroot -pmysqldump -u root -p mydb > mydb.sqlFROM mariadb ENV MYSQL_ROOT_PASSWORD test1357 ENV MYSQL_DATABASE mydb COPY ./mydb.sql /docker-entrypoint-initdb.d/ EXPOSE 3306
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
jpa 질문있습니다
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. JPA가 인터페이스이고하이버네이트나 OpenJpa같은 구현체들이 있고javax.persistence.* 패키지에서 제공 하는 JPA인터페이스 어노테이션들 ( ex @Id, @JoinColumn , @ManyToOne등등 )이것들은 JPA가 제공하는것들이고, 구현체가 제공하는 어노테이션들 ( ex 하이버네이트의 import org.hibernate.annotations. 패키지 @JoinFormula()등 )이것들은 하이버네이트가 제공하는 어노테이션이라는걸 인지 했습니다여기서 궁금한게제 상식으로는 인터페이스는 독단적으로 사용 할 수 없는것으로 알고 있는데지금 영한님이 설명해주시는 예제들은 하이버네이트가 제공하는 패키지들에 있는 어노테이션을 사용하지 않고 jpa가 제공하는 패키지의 어노테이션들 ( javax.persistence.* 의 @ManyToOne 등등)만 사용해서 예제를 만들고 계신데 이렇게 되면 구현체 없이 jpa라는 인터페이스만으로 개발을 한거라고 이해가 되는데 이게 맞는 걸까요? 맞다면 어떻게 가능한거고 , 여기서 하이버네이트 의존성을 지워버려도 개발이 가능한지도 여쭤보고 싶습니다. 감사합니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
엔티티 클래스2 강의 부분입니다.
=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]실행했을때 H2 DB에CATEGORY,CATEGORY_ITEM,DELIVERY,ITEM,MEMBER,ORDERS,ORDER_ITEM 테이블이 생성되지않아서 문의드립니다.https://drive.google.com/file/d/1N63HWFHbE41DV2aGqkyVLrSnDDhDPcYg/view?usp=drive_link코드 피드백 해주시면 감사하겠습니다.
-
미해결스프링 프레임워크는 내 손에 [스프2탄]
섹션 01 8강 질문입니다
8강 스프2탄_Junit리스트보기 Controller테스트 강의 중 질문입니다.테스트코드 BoardControllerTest.java에서@Testpublic void testList() throws Exception{log.info(mockMvc.perform(MockMvcRequestBuilders.get("/board/list")).andReturn().getModelAndView().getModelMap());} 굵은 글씨 get이라고 하셨는데BoardController.java에서@GetMapping("/list")public String getList(Model model) {List<Board> list=boardService.getList();// 객체바인딩model.addAttribute("list",list);return "board/boardList";}굵은 글씨 @GetMapping이라고 해줘서 테스트코드에서 get인 것은 알겠는데왜 get이라고 해 줬는데 이해가 잘 안되서요..특별한 거 없으면 그냥 get이라고 해주면 되는 건가요? 두번째 질문은다음 강의 언제 나오나요
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
강의자료 주소 좀 알려주세요.
강의자료를 볼 수 있는 github가 있었던 것 같은데아무리 찾아도 없네요.강의자료 다운 혹은 볼 수 있는 주소 좀 알려주세요.
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
JPA, QueryDsl을 upsert처럼 사용할 수 있을까요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]안녕하세요JPA, QueryDsl 조합으로 upsert를 대신 할 수 있을지가 궁금하여 질문드립니다[우아콘2020] QueryDSL 편에서 bulk insert는 자제하라는 말씀이 있었습니다하여, 실무에서는 upsert를 대신해서 batch에서 대용량 데이터를 insert, update 할 때 어떤 방식을 사용하시는지도 궁금합니다!
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
테이블 드랍이 안됩니다..
실전 예제 4를 하고 있는데 create로 설정하면 메인메서드 실행할 때마다 테이블 드랍되고 실행되어야하는데 아래와 같은 오류가 자꾸 발생하면서 실행이 안되는데 왜그럴까요 ㅠㅠ 수동으로 데이터베이스에서 드랍하고 실행하거나 update 등으로만 설정해야 잘 작동되는데 왜그럴까요... /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=49362:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/hwang-gyuhyeog/Desktop/JPA/1.자바 ORM 표준 JPA 프로그래밍-기본편/jpashop/target/classes:/Users/hwang-gyuhyeog/.m2/repository/org/hibernate/hibernate-entitymanager/5.3.10.Final/hibernate-entitymanager-5.3.10.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/org/hibernate/hibernate-core/5.3.10.Final/hibernate-core-5.3.10.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/org/javassist/javassist/3.23.2-GA/javassist-3.23.2-GA.jar:/Users/hwang-gyuhyeog/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/hwang-gyuhyeog/.m2/repository/org/jboss/jandex/2.0.5.Final/jandex-2.0.5.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar:/Users/hwang-gyuhyeog/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:/Users/hwang-gyuhyeog/.m2/repository/org/dom4j/dom4j/2.1.1/dom4j-2.1.1.jar:/Users/hwang-gyuhyeog/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.4.Final/hibernate-commons-annotations-5.0.4.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar:/Users/hwang-gyuhyeog/.m2/repository/net/bytebuddy/byte-buddy/1.9.5/byte-buddy-1.9.5.jar:/Users/hwang-gyuhyeog/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/1.1.1.Final/jboss-transaction-api_1.2_spec-1.1.1.Final.jar:/Users/hwang-gyuhyeog/.m2/repository/com/h2database/h2/1.4.200/h2-1.4.200.jar:/Users/hwang-gyuhyeog/.m2/repository/javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar jpabook.jpashop.JpaMain8월 08, 2023 10:39:56 오후 org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformationINFO: HHH000204: Processing PersistenceUnitInfo [ name: hello ...]8월 08, 2023 10:39:56 오후 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {5.3.10.Final}8월 08, 2023 10:39:56 오후 org.hibernate.cfg.Environment <clinit>INFO: HHH000206: hibernate.properties not found8월 08, 2023 10:39:57 오후 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>INFO: HCANN000001: Hibernate Commons Annotations {5.0.4.Final}8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configureWARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001005: using driver [org.h2.Driver] at URL [jdbc:h2:tcp://localhost/~/jpashop]8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001001: Connection properties: {user=sa}8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreatorINFO: HHH10001003: Autocommit mode: false8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections <init>INFO: HHH000115: Hibernate connection pool size: 20 (min=1)8월 08, 2023 10:39:57 오후 org.hibernate.dialect.Dialect <init>INFO: HHH000400: Using dialect: org.hibernate.dialect.H2DialectHibernate: drop table Category if existsHibernate: drop table CATEGORY_ITEM if existsHibernate: drop table Delivery if existsHibernate: drop table Item if existsHibernate: drop table Member if existsHibernate: drop table OrderItem if existsHibernate: drop table ORDERS if existsHibernate: drop sequence if exists hibernate_sequenceHibernate: create sequence hibernate_sequence start with 1 increment by 18월 08, 2023 10:39:57 오후 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnectionINFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@7f5b9db] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " drop table Category if exists" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " drop table Category if exists" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:375) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:359) at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:241) at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:154) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:126) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:112) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:144) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Cannot drop "CATEGORY" because "FKJIP0OR3VEMIXCCL6VX0KLUJ03" depends on it; SQL statement: drop table Category if e [90107-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:632) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.command.ddl.DropTable.prepareDrop(DropTable.java:97) at org.h2.command.ddl.DropTable.update(DropTable.java:121) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " drop table Delivery if exists" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " drop table Delivery if exists" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:375) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:359) at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:241) at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:154) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:126) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:112) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:144) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Cannot drop "DELIVERY" because "FKDBS21F1YI0COXY9Y0KXW4G9JF" depends on it; SQL statement: drop table Delivery if e [90107-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:632) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.command.ddl.DropTable.prepareDrop(DropTable.java:97) at org.h2.command.ddl.DropTable.update(DropTable.java:121) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " drop table Item if exists" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " drop table Item if exists" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:375) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:359) at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:241) at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:154) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:126) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:112) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:144) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Cannot drop "ITEM" because "FK75MRPPRV8OIGH00Y92TIBW7ID, FK2SRBE8WJBANR4VTKRSB8ATQ7O, FKQQWSWM36Y8UQOH9EMTORUOXCV, FKABGE9EQALSPCEJIJ53RAT7PJH" depends on it; SQL statement: drop table Item if e [90107-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:632) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.command.ddl.DropTable.prepareDrop(DropTable.java:97) at org.h2.command.ddl.DropTable.update(DropTable.java:121) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " drop table Member if exists" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " drop table Member if exists" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlString(SchemaDropperImpl.java:375) at org.hibernate.tool.schema.internal.SchemaDropperImpl.applySqlStrings(SchemaDropperImpl.java:359) at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:241) at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:154) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:126) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:112) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:144) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Cannot drop "MEMBER" because "FKH0DB7KQR88ED8HQTCQW3JKCIA" depends on it; SQL statement: drop table Member if e [90107-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:632) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.command.ddl.DropTable.prepareDrop(DropTable.java:97) at org.h2.command.ddl.DropTable.update(DropTable.java:121) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnectionINFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@5c723f2d] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " create table Category ( id bigint not null, name varchar(255), PARENT_ID bigint, primary key (id) )" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " create table Category ( id bigint not null, name varchar(255), PARENT_ID bigint, primary key (id) )" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "CATEGORY" already exists; SQL statement: create table Category ( id bigint not null, name varchar(255), PARENT_ID bigint, primary key (id) [42101-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.command.ddl.CreateTable.update(CreateTable.java:91) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " create table Delivery ( id bigint not null, city varchar(255), deliveryStatus integer, street varchar(255), zipcode varchar(255), primary key (id) )" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " create table Delivery ( id bigint not null, city varchar(255), deliveryStatus integer, street varchar(255), zipcode varchar(255), primary key (id) )" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "DELIVERY" already exists; SQL statement: create table Delivery ( id bigint not null, city varchar(255), deliveryStatus integer, street varchar(255), zipcode varchar(255), primary key (id) [42101-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.command.ddl.CreateTable.update(CreateTable.java:91) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " create table Item ( DTYPE varchar(31) not null, ITEM_ID bigint not null, name varchar(255), price integer not null, stockQuantity integer not null, actor varchar(255), director varchar(255), author varchar(255), isbn varchar(255), artist varchar(255), etc varchar(255), primary key (ITEM_ID) )" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " create table Item ( DTYPE varchar(31) not null, ITEM_ID bigint not null, name varchar(255), price integer not null, stockQuantity integer not null, actor varchar(255), director varchar(255), author varchar(255), isbn varchar(255), artist varchar(255), etc varchar(255), primary key (ITEM_ID) )" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ITEM" already exists; SQL statement: create table Item ( DTYPE varchar(31) not null, ITEM_ID bigint not null, name varchar(255), price integer not null, stockQuantity integer not null, actor varchar(255), director varchar(255), author varchar(255), isbn varchar(255), artist varchar(255), etc varchar(255), primary key (ITEM_ID) [42101-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.command.ddl.CreateTable.update(CreateTable.java:91) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " create table Member ( MEMBER_ID bigint not null, city varchar(255), name varchar(255), street varchar(255), zipcode varchar(255), primary key (MEMBER_ID) )" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " create table Member ( MEMBER_ID bigint not null, city varchar(255), name varchar(255), street varchar(255), zipcode varchar(255), primary key (MEMBER_ID) )" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:315) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "MEMBER" already exists; SQL statement: create table Member ( MEMBER_ID bigint not null, city varchar(255), name varchar(255), street varchar(255), zipcode varchar(255), primary key (MEMBER_ID) [42101-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.command.ddl.CreateTable.update(CreateTable.java:91) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 more8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl handleExceptionWARN: GenerationTarget encountered exception accepting command : Error executing DDL " alter table Category add constraint FK8tepc1qkmluodspg6tnliwhit foreign key (PARENT_ID) references Category" via JDBC Statementorg.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL " alter table Category add constraint FK8tepc1qkmluodspg6tnliwhit foreign key (PARENT_ID) references Category" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlString(SchemaCreatorImpl.java:440) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.applySqlStrings(SchemaCreatorImpl.java:424) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.createFromMetadata(SchemaCreatorImpl.java:375) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.performCreation(SchemaCreatorImpl.java:166) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:135) at org.hibernate.tool.schema.internal.SchemaCreatorImpl.doCreation(SchemaCreatorImpl.java:121) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:155) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) at jpabook.jpashop.JpaMain.main(JpaMain.java:14)Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Constraint "FK8TEPC1QKMLUODSPG6TNLIWHIT" already exists; SQL statement: alter table Category add constraint FK8tepc1qkmluodspg6tnliwhit foreign key (PARENT_ID) references Cat [90045-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:632) at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) at org.h2.message.DbException.get(DbException.java:223) at org.h2.message.DbException.get(DbException.java:199) at org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:109) at org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:72) at org.h2.command.ddl.AlterTable.update(AlterTable.java:46) at org.h2.command.CommandContainer.update(CommandContainer.java:169) at org.h2.command.Command.executeUpdate(Command.java:252) at org.h2.server.TcpServerThread.process(TcpServerThread.java:408) at org.h2.server.TcpServerThread.run(TcpServerThread.java:191) at java.base/java.lang.Thread.run(Thread.java:834) at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) at org.h2.engine.SessionRemote.done(SessionRemote.java:611) at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:237) at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ... 15 moreHibernate: create table Category ( id bigint not null, name varchar(255), PARENT_ID bigint, primary key (id) )Hibernate: create table CATEGORY_ITEM ( CATEGORY_ID bigint not null, ITEM_ID bigint not null )Hibernate: create table Delivery ( id bigint not null, city varchar(255), deliveryStatus integer, street varchar(255), zipcode varchar(255), primary key (id) )Hibernate: create table Item ( DTYPE varchar(31) not null, ITEM_ID bigint not null, name varchar(255), price integer not null, stockQuantity integer not null, actor varchar(255), director varchar(255), author varchar(255), isbn varchar(255), artist varchar(255), etc varchar(255), primary key (ITEM_ID) )Hibernate: create table Member ( MEMBER_ID bigint not null, city varchar(255), name varchar(255), street varchar(255), zipcode varchar(255), primary key (MEMBER_ID) )Hibernate: create table OrderItem ( ORDER_ITEM_ID bigint not null, ITEM_ID bigint, ORDER_ID bigint, primary key (ORDER_ITEM_ID) )Hibernate: create table ORDERS ( ORDER_ID bigint not null, orderDate timestamp, status varchar(255), DELIVERY_ID bigint, MEMBER_ID bigint, primary key (ORDER_ID) )Hibernate: alter table Category add constraint FK8tepc1qkmluodspg6tnliwhit foreign key (PARENT_ID) references CategoryHibernate: alter table CATEGORY_ITEM add constraint FKf1uerpnmn49vl1spbbplgxaun foreign key (ITEM_ID) references ItemHibernate: alter table CATEGORY_ITEM add constraint FKjip0or3vemixccl6vx0kluj03 foreign key (CATEGORY_ID) references CategoryHibernate: alter table OrderItem add constraint FKabge9eqalspcejij53rat7pjh foreign key (ITEM_ID) references ItemHibernate: alter table OrderItem add constraint FKk7lmf97wukpquk6d8blxy5neq foreign key (ORDER_ID) references ORDERSHibernate: alter table ORDERS add constraint FKdbs21f1yi0coxy9y0kxw4g9jf foreign key (DELIVERY_ID) references DeliveryHibernate: alter table ORDERS add constraint FKh0db7kqr88ed8hqtcqw3jkcia foreign key (MEMBER_ID) references Member8월 08, 2023 10:39:57 오후 org.hibernate.tool.schema.internal.SchemaCreatorImpl applyImportSourcesINFO: HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@30f74e79'Hibernate: call next value for hibernate_sequenceHibernate: /* insert jpabook.jpashop.domain.Book */ insert into Item (name, price, stockQuantity, author, isbn, DTYPE, ITEM_ID) values (?, ?, ?, ?, ?, 'Book', ?)8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsWARN: SQL Error: 23505, SQLState: 235058월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsERROR: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.ITEM(ITEM_ID) ( /* key:1 */ 'Book', CAST(1 AS BIGINT), 'dd', 0, 0, NULL, NULL, 'abc', NULL, NULL, NULL)"; SQL statement:/* insert jpabook.jpashop.domain.Book */ insert into Item (name, price, stockQuantity, author, isbn, DTYPE, I [23505-200]8월 08, 2023 10:39:57 오후 org.hibernate.internal.ExceptionMapperStandardImpl mapManagedFlushFailureERROR: HHH000346: Error during managed flush [org.hibernate.exception.ConstraintViolationException: could not execute statement]8월 08, 2023 10:39:57 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stopINFO: HHH10001008: Cleaning up connection pool [jdbc:h2:tcp://localhost/~/jpashop]Process finished with exit code 0
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
순수 자바 테스트
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 안녕하세요. 강의 내에서 스프링 없이 테스트 코드를 짜는 것이 좋다고 하신 것을 보고 실제로 테스트 코드는 스프링을 의존하지 않고 짜는 것이 무엇인지 궁금해졌습니다.실제로 강의에서 작성하는 내용 중에, 어느 부분이 스프링에 의존해서 테스트를 한 것인지, 또한 그러한 스프링 의존 테스트를 순수 자바 기반의 테스트로 바꾸며 어떤 식으로 나오게 될지 궁금합니다. 감사합니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
The request was rejected because the URL contained a potentially malicious String "%0A"
UserServiceImplString orderUrl = String.format(env.getProperty("order_service.url"), userId);user-service.ymlorder_service: url: http://127.0.0.1:8000/order-service/%s/orders The request was rejected because the URL contained a potentially malicious String "%0A"실행 중에 해당 에러가 발생했습니다.springSecurity가 버전업 되어 %s같은 것들을 사용하지 못하게 막은 것 같은데 해결 방안을 알고 싶습니다.정확한 에러는 아래와 같습니다.org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String "%0A"*spring Security 2.7.12
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
kafka connectors 에러
안녕하세요 강의 잘 듣고 있습니다.!!127.0.0.1:8083/connectors로 POST 요청으로{ "name": "my-source-connect", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "connection.url": "jdbc:mariadb://localhost:3306/mydb", "connection.user": "root", "connection.password": "지정한 password", "mode": "incrementing", "incrementing.column.name": "id", "table.whitelist": "users", "topic.prefix": "my_topic_", "tasks.max": "1" } }201 응답으로 잘 왔습니다.{ "name": "my-source-connect2", "config": { "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector", "connection.url": "jdbc:mariadb://localhost:3306/mydb", "connection.user": "root", "connection.password": "지정한 password", "mode": "incrementing", "incrementing.column.name": "id", "table.whitelist": "users", "topic.prefix": "my_topic_", "tasks.max": "1", "name": "my-source-connect2" }, "tasks": [], "type": "source" }127.0.0.1:8083/connectors/my-source-connect/status를 보니{ "name": "my-source-connect", "connector": { "state": "FAILED", "worker_id": "192.168.200.174:8083", "trace": "org.apache.kafka.connect.errors.ConnectException: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydb\n\tat io.confluent.connect.jdbc.util.CachedConnectionProvider.getConnection(CachedConnectionProvider.java:62)\n\tat io.confluent.connect.jdbc.JdbcSourceConnector.start(JdbcSourceConnector.java:95)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.doStart(WorkerConnector.java:190)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.start(WorkerConnector.java:215)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:360)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:343)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.doRun(WorkerConnector.java:143)\n\tat org.apache.kafka.connect.runtime.WorkerConnector.run(WorkerConnector.java:121)\n\tat org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:181)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\nCaused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/mydb\n\tat java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706)\n\tat java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190)\n\tat io.confluent.connect.jdbc.dialect.GenericDatabaseDialect.getConnection(GenericDatabaseDialect.java:250)\n\tat io.confluent.connect.jdbc.util.CachedConnectionProvider.newConnection(CachedConnectionProvider.java:84)\n\tat io.confluent.connect.jdbc.util.CachedConnectionProvider.getConnection(CachedConnectionProvider.java:54)\n\t... 13 more\n" }, "tasks": [], "type": "source" }터미널에서 확인해보니 127.0.0.1:8083/connectors로 POST 요청으로 보낼 때[2023-08-08 19:11:24,848] INFO JdbcSourceConnectorConfig values: batch.max.rows = 100 catalog.pattern = null connection.attempts = 3 connection.backoff.ms = 10000 connection.password = [hidden] connection.url = jdbc:mariadb://localhost:3306/mydb connection.user = root db.timezone = UTC dialect.name = incrementing.column.name = id mode = incrementing numeric.mapping = null numeric.precision.mapping = false poll.interval.ms = 5000 query = query.retry.attempts = -1 query.suffix = quote.sql.identifiers = ALWAYS schema.pattern = null table.blacklist = [] table.monitoring.startup.polling.limit.ms = 10000 table.poll.interval.ms = 60000 table.types = [TABLE] table.whitelist = [users] timestamp.column.name = [] timestamp.delay.interval.ms = 0 timestamp.granularity = connect_logical timestamp.initial = null topic.prefix = my_topic_ transaction.isolation.mode = DEFAULT validate.non.null = true (io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig:376) [2023-08-08 19:11:24,850] INFO AbstractConfig values: (org.apache.kafka.common.config.AbstractConfig:376) [2023-08-08 19:11:24,856] INFO [Worker clientId=connect-1, groupId=connect-cluster] Connector my-source-connect2 config updated (org.apache.kafka.connect.runtime.distributed.DistributedHerder:2092) [2023-08-08 19:11:24,858] INFO [Worker clientId=connect-1, groupId=connect-cluster] Rebalance started (org.apache.kafka.connect.runtime.distributed.WorkerCoordinator:231) [2023-08-08 19:11:24,858] INFO [Worker clientId=connect-1, groupId=connect-cluster] (Re-)joining group (org.apache.kafka.connect.runtime.distributed.WorkerCoordinator:566) [2023-08-08 19:11:24,860] INFO 127.0.0.1 - - [08/8월/2023:10:11:24 +0000] "POST /connectors HTTP/1.1" 201 400 "-" "PostmanRuntime/7.32.3" 18 (org.apache.kafka.connect.runtime.rest.RestServer:62) [2023-08-08 19:11:24,861] INFO [Worker clientId=connect-1, groupId=connect-cluster] Successfully joined group with generation Generation{generationId=4, memberId='connect-1-a7b22fdb-774a-479a-9618-b4e9504e4e95', protocol='sessioned'} (org.apache.kafka.connect.runtime.distributed.WorkerCoordinator:627) [2023-08-08 19:11:24,866] INFO [Worker clientId=connect-1, groupId=connect-cluster] Successfully synced group in generation Generation{generationId=4, memberId='connect-1-a7b22fdb-774a-479a-9618-b4e9504e4e95', protocol='sessioned'} (org.apache.kafka.connect.runtime.distributed.WorkerCoordinator:802) [2023-08-08 19:11:24,866] INFO [Worker clientId=connect-1, groupId=connect-cluster] Joined group at generation 4 with protocol version 2 and got assignment: Assignment{error=0, leader='connect-1-a7b22fdb-774a-479a-9618-b4e9504e4e95', leaderUrl='http://192.168.200.174:8083/', offset=5, connectorIds=[my-source-connect2, my-source-connect1, my-source-connect], taskIds=[], revokedConnectorIds=[], revokedTaskIds=[], delay=0} with rebalance delay: 0 (org.apache.kafka.connect.runtime.distributed.DistributedHerder:2282) [2023-08-08 19:11:24,866] INFO [Worker clientId=connect-1, groupId=connect-cluster] Starting connectors and tasks using config offset 5 (org.apache.kafka.connect.runtime.distributed.DistributedHerder:1676) [2023-08-08 19:11:24,867] INFO [Worker clientId=connect-1, groupId=connect-cluster] Starting connector my-source-connect2 (org.apache.kafka.connect.runtime.distributed.DistributedHerder:1793) [2023-08-08 19:11:24,867] INFO [my-source-connect2|worker] Creating connector my-source-connect2 of type io.confluent.connect.jdbc.JdbcSourceConnector (org.apache.kafka.connect.runtime.Worker:293) [2023-08-08 19:11:24,867] INFO [my-source-connect2|worker] SourceConnectorConfig values: config.action.reload = restart connector.class = io.confluent.connect.jdbc.JdbcSourceConnector errors.log.enable = false errors.log.include.messages = false errors.retry.delay.max.ms = 60000 errors.retry.timeout = 0 errors.tolerance = none exactly.once.support = requested header.converter = null key.converter = null name = my-source-connect2 offsets.storage.topic = null predicates = [] tasks.max = 1 topic.creation.groups = [] transaction.boundary = poll transaction.boundary.interval.ms = null transforms = [] value.converter = null (org.apache.kafka.connect.runtime.SourceConnectorConfig:376) [2023-08-08 19:11:24,867] INFO [my-source-connect2|worker] EnrichedConnectorConfig values: config.action.reload = restart connector.class = io.confluent.connect.jdbc.JdbcSourceConnector errors.log.enable = false errors.log.include.messages = false errors.retry.delay.max.ms = 60000 errors.retry.timeout = 0 errors.tolerance = none exactly.once.support = requested header.converter = null key.converter = null name = my-source-connect2 offsets.storage.topic = null predicates = [] tasks.max = 1 topic.creation.groups = [] transaction.boundary = poll transaction.boundary.interval.ms = null transforms = [] value.converter = null (org.apache.kafka.connect.runtime.ConnectorConfig$EnrichedConnectorConfig:376) [2023-08-08 19:11:24,868] INFO [my-source-connect2|worker] Instantiated connector my-source-connect2 with version 10.7.3 of type class io.confluent.connect.jdbc.JdbcSourceConnector (org.apache.kafka.connect.runtime.Worker:315) [2023-08-08 19:11:24,868] INFO [my-source-connect2|worker] Finished creating connector my-source-connect2 (org.apache.kafka.connect.runtime.Worker:336) [2023-08-08 19:11:24,868] INFO [Worker clientId=connect-1, groupId=connect-cluster] Finished starting connectors and tasks (org.apache.kafka.connect.runtime.distributed.DistributedHerder:1704) [2023-08-08 19:11:24,868] INFO [my-source-connect2|worker] Starting JDBC Source Connector (io.confluent.connect.jdbc.JdbcSourceConnector:71) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] JdbcSourceConnectorConfig values: batch.max.rows = 100 catalog.pattern = null connection.attempts = 3 connection.backoff.ms = 10000 connection.password = [hidden] connection.url = jdbc:mariadb://localhost:3306/mydb connection.user = root db.timezone = UTC dialect.name = incrementing.column.name = id mode = incrementing numeric.mapping = null numeric.precision.mapping = false poll.interval.ms = 5000 query = query.retry.attempts = -1 query.suffix = quote.sql.identifiers = ALWAYS schema.pattern = null table.blacklist = [] table.monitoring.startup.polling.limit.ms = 10000 table.poll.interval.ms = 60000 table.types = [TABLE] table.whitelist = [users] timestamp.column.name = [] timestamp.delay.interval.ms = 0 timestamp.granularity = connect_logical timestamp.initial = null topic.prefix = my_topic_ transaction.isolation.mode = DEFAULT validate.non.null = true (io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig:376) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] Validating JDBC URL. (io.confluent.connect.jdbc.dialect.DatabaseDialects:171) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] Validated JDBC URL. (io.confluent.connect.jdbc.dialect.DatabaseDialects:174) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] Validating JDBC URL. (io.confluent.connect.jdbc.dialect.DatabaseDialects:171) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] Validated JDBC URL. (io.confluent.connect.jdbc.dialect.DatabaseDialects:174) [2023-08-08 19:11:24,869] INFO [my-source-connect2|worker] Initial connection attempt with the database. (io.confluent.connect.jdbc.JdbcSourceConnector:94) [2023-08-08 19:11:24,871] INFO [my-source-connect2|worker] Unable to connect to database on attempt 1/3. Will retry in 10000 ms. (io.confluent.connect.jdbc.util.CachedConnectionProvider:90) java.sql.SQLException: No suitable driver found for jdbc:mariadb://localhost:3306/mydb at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190) at io.confluent.connect.jdbc.dialect.GenericDatabaseDialect.getConnection(GenericDatabaseDialect.java:250) at io.confluent.connect.jdbc.util.CachedConnectionProvider.newConnection(CachedConnectionProvider.java:84) at io.confluent.connect.jdbc.util.CachedConnectionProvider.getConnection(CachedConnectionProvider.java:54) at io.confluent.connect.jdbc.JdbcSourceConnector.start(JdbcSourceConnector.java:95) at org.apache.kafka.connect.runtime.WorkerConnector.doStart(WorkerConnector.java:190) at org.apache.kafka.connect.runtime.WorkerConnector.start(WorkerConnector.java:215) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:360) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:343) at org.apache.kafka.connect.runtime.WorkerConnector.doRun(WorkerConnector.java:143) at org.apache.kafka.connect.runtime.WorkerConnector.run(WorkerConnector.java:121) at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:181) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) [2023-08-08 19:11:34,877] INFO [my-source-connect2|worker] Unable to connect to database on attempt 2/3. Will retry in 10000 ms. (io.confluent.connect.jdbc.util.CachedConnectionProvider:90) java.sql.SQLException: No suitable driver found for jdbc:mariadb://localhost:3306/mydb at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190) at io.confluent.connect.jdbc.dialect.GenericDatabaseDialect.getConnection(GenericDatabaseDialect.java:250) at io.confluent.connect.jdbc.util.CachedConnectionProvider.newConnection(CachedConnectionProvider.java:84) at io.confluent.connect.jdbc.util.CachedConnectionProvider.getConnection(CachedConnectionProvider.java:54) at io.confluent.connect.jdbc.JdbcSourceConnector.start(JdbcSourceConnector.java:95) at org.apache.kafka.connect.runtime.WorkerConnector.doStart(WorkerConnector.java:190) at org.apache.kafka.connect.runtime.WorkerConnector.start(WorkerConnector.java:215) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:360) at org.apache.kafka.connect.runtime.WorkerConnector.doTransitionTo(WorkerConnector.java:343) at org.apache.kafka.connect.runtime.WorkerConnector.doRun(WorkerConnector.java:143) at org.apache.kafka.connect.runtime.WorkerConnector.run(WorkerConnector.java:121) at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:181) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)으로 발생합니다. 에러를 보니 java.sql.SQLException: No suitable driver found for jdbc:mariadb://localhost:3306/mydbKafka Connect 런타임에서 MariaDB의 JDBC 드라이버를 찾지 못한거 같았습니다.~/confluent-7.4.0/etc/kafka/connectdistributed.properties 경로에plugin.path=/Users/ryu/kafka/confluentinc-kafka-connect-jdbc-10.7.3/lib잘 지정해준거 같았고 문제가 예상되는 부분은 현재 gradle을 사용해서 예제를 따라하고 있었습니다. ...Maven Local Repository에 라이브러리 배포하는 식으로해서plugins { id 'java-library' id 'maven-publish' id 'org.springframework.boot' version '2.7.14' id 'io.spring.dependency-management' version '1.0.15.RELEASE' } group = 'com.spring' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } ext { set('springCloudVersion', "2021.0.8") } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' implementation 'org.modelmapper:modelmapper:2.4.5' implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.2' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2:1.3.176' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' } dependencyManagement { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" } } tasks.named('test') { useJUnitPlatform() } publishing { publications { maven(MavenPublication) { groupId = 'org.mariadb.jdbc' // groupId artifactId = 'mariadb-java-client' // artifactId version = '2.7.2' // version from components.java } } }publishMavenPublicationToMavenLocal 을 통해서 배포해버리고...maven의 기본 repository인 .m2에서 확인했을 때.jar 파일이 mariadb-java-client-3.1.4-plain.jar 밖에 없어 사용했는데 혹시 gradle을 이용하면서 해결할 수 있는 방법이 있을까요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
window11 / 23.08.08 기준 설정
Eralang 최신버전 다운 가정 하에환경변수 ERLANG_HOME : C:\Program Files\Erlang OTP 추가기존의 path 변수에 %ERLANG_HOME%\bin 추가그 후 rabbitmq command prompt 여신 후 rabbitmq-server -detachedrabbitmq-plugins enable rabbitmq_management 순서대로 입력만약 안될 시에 rabbitmq-service.bat removerabbitmq-service.bat installrabbitmq-server -detachedrabbitmq-plugins enable rabbitmq_management 순서로 입력
-
미해결실전! 스프링 데이터 JPA
연관관계없이 테이블 설계 및 JPA Domain Class 작성 문의
안녕하세요. 현재 김영한님의 JPA관련 강의들을 수강하면서 기존 프로젝트에서 JPA 로 변경시 문제가 있어 문의드립니다.배운 것을 실적용할 경우 문제는, 테이블 설계시 제약사항이 테이블 간 연관관계 설정을 하지 않는 것입니다.이 경우 도메인클래스를 어떻게 작성해야 할지 적절한 기준과 방법을 몰라 문의드립니다.간략히 예를들어 DBA권고에 따라 외래키 설정은 모두 하지 않는다고 가정해서 아래와 같이 테이블을 생성했을 시에| COMMENT | | COMMENT_IMAGE | | comment_id(PK)| | comment_img_id(PK)| | user_name(PK) | ------- X ------ | comment_img_name | | comment_id | /* DO NOT USE CONSTRAINT foreign key() references */따라서 기존에 아래와 같은 DTO가 있다면,public class Comment { .... private Long id; private String name; private List<CommentImage> commentImages; .... }로 작성되어 있을 경우 아래와 같이 수정중인데... @IdClass(CommentId.class) public class Comment { .... @Id private Long id; @Id private String name; //@? private List<CommentImage> commentImages; .... }기존에는 따로 CommentImage List<>를 조회해서 넣어주면 됐지만cmt = DAO.getComment(id, name); cmt.setCommentImages( DAO.getCommentImageList( cmt.getId() ) ); return cmt; /* getComment SQL SELECT * FROM COMMENT WHERE COMMENT_ID = :id AND USER_NAME = :name; getCommentImageList SQL SELECT * FROM COMMENT_IMAGE WHERE COMMENT_ID = :comment_id; */ JPA의 경우 Domain 클래스에서 Join관련 어노테이션 설정이 없으면 Could not determine recommended JdbcType 오류가 발생합니다. 이 경우 연관관계 생성없이 도메인을 설계하고 사용하는 방법을 알 수 있을까요?