inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

JPA 소개 - 1차 캐시와 동일성 보장 에서 질문이 있습니다!

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요, 영한님! 영한님 수업을 새겨듣고 있는 수강자입니다! 다름이 아니라, JPA 소개파트의 "1차 캐시와 동일성 보장(15분 30초경)" 에서 말씀하신 동일성이 "각 Entity가 참조하는 메모리 주소가 같지 않아도 값을 통해 같음을 보장"한다는 뜻과 일맥상통한 내용인가요? Java의 equals에 대해서 공부하다가 동일성이란 단어가 동일한 의미로 쓰이는지 궁금해서 여쭈어봐요! 만약에 같은 뜻이라면, "같은 엔티티를 반환한다"는 말을 "참조하는 메모리 주소가 같지는 않고, 값만 같은 엔티티를 반환한다"로 이해해도 될까요?? 질문 들어주셔서 감사합니다. 오늘도 좋은 하루 보내세요!!

  • java
  • jpa
윤수정 댓글 1 좋아요 0 조회수 660

Material Theme 테마 관련해서 질문 드립니다.

미해결

탄탄한 백엔드 NestJS, 기초부터 심화까지

똑같이 설치 했는데 왜 저는 강사님 처럼 데코레이터는 파란색 함수명은 빨간색으로 하고 싶은데 저는 이 2개가 같이 바뀌네요 ? ㅠ 스코프를 아래와 같이 설정하면, 데코랑 함수명이 같이 움직입니다. 따로 셋팅은 힘든 걸가요? "scope": [" entity.name .function"], "settings": { "foreground": "#FFFF00" }

  • node.js
  • mongodb
  • express
  • nestjs
  • ssr
jangkeya 댓글 1 좋아요 0 조회수 373

WSL2로 강의 수강 시 문제점에 관하여 아래 내용여쭙고 싶어 글 남깁니다.

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요. 백엔드 과정을 수강 중인 학생입니다. WSL2로 강의 수강 시 문제점에 관하여 아래 내용여쭙고 싶어 글 남깁니다. 번거롭겠지만 답변해주시면 정말 감사하겠습니다. 현재 16GB RAM 사용 중이며 윈도우 기본 설치된 노트북을 사용 중입니다. 윈도우를 제거하고 우분투를 설치할 환경이 되지 않아서 WSL2를 설치하여 사용하려 하는데 강의를 들으면서 추후 RAM 관련 문제가 발생할 수 있을까요? ***아래 캡처는 현재 제 노트북 사양입니다*** [캡처]

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
건희 댓글 2 좋아요 0 조회수 596

Chap7 퀴즈

해결됨

나도코딩의 자바 기본편 - 풀코스 (20시간)

안녕하세요! 7강 마무리 퀴즈를 스스로 풀어보며 의문점이 생겨 질문 남깁니다. 저는 이런식으로 name 변수를 선언하고 cook() 메소드에 this.name을 활용했는데, 강의에선 기본 생성자와 name을 매개변수로 하는 생성자를 정의하고 풀어 주셨더라구요! 결과는 같게 나오지만 혹시 생성자를 사용하는게 더 좋은 코딩 방법인지, 제가 한 방식이 결과는 맞지만 논리적 오류가 있는지 궁금합니다. 그리고 강의 잘 듣고 있습니다. 감사합니다!

  • java
  • 객체지향
andy15948 댓글 1 좋아요 0 조회수 176

도커 yarn install

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

#0 10.10 error @graphql-tools/merge@9.0.0: The engine "node" is incompatible with this module. Expected version ">=16.0.0". Got "14.21.3" #0 10.10 error Found incompatible module. #0 10.10 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ------ Dockerfile:10 -------------------- 8 | COPY ./yarn.lock /myfolder/ 9 | WORKDIR /myfolder/ 10 | >>> RUN yarn install 11 | 12 | COPY . /myfolder/ -------------------- ERROR: failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1 ERROR: Service 'my-backend' failed to build : Build failed docker-compse bulid 했을때 에러가 발생합니다

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
WooQ 댓글 1 좋아요 0 조회수 1143

npm run db:create

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

import { DataSource } from 'typeorm'; import dotenv from 'dotenv'; import { ChannelChats } from './src/entities/ChannelChats'; import { ChannelMembers } from './src/entities/ChannelMembers'; import { Channels } from './src/entities/Channels'; import { DMs } from './src/entities/DMs'; import { Mentions } from './src/entities/Mentions'; import { Users } from './src/entities/Users'; import { WorkspaceMembers } from './src/entities/WorkspaceMembers'; import { Workspaces } from './src/entities/Workspaces'; dotenv.config(); const dataSource = new DataSource({ type: 'mysql', host: 'localhost', port: 3306, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, database: process.env.DB_DATABASE, entities: [ ChannelChats, ChannelMembers, Channels, DMs, Mentions, Users, WorkspaceMembers, Workspaces, ], migrations: [__dirname + '/src/migrations/*.ts'], charset: 'utf8mb4_general_ci', synchronize: false, logging: true, }); export default dataSource; 에러! Error: Can't add new command when connection is in closed state at Connection._addCommandClosedState (/Users/minchankim/Desktop/study/nestToy/node_modules/mysql2/lib/connection.js:148:17) at Connection.end (/Users/minchankim/Desktop/study/nestToy/node_modules/mysql2/lib/connection.js:855:26) at Query.onResult (/Users/minchankim/Desktop/study/nestToy/node_modules/typeorm-extension/dist/database/driver/mysql.js:27:28) at Connection._notifyError (/Users/minchankim/Desktop/study/nestToy/node_modules/mysql2/lib/connection.js:228:17) at Connection._handleFatalError (/Users/minchankim/Desktop/study/nestToy/node_modules/mysql2/lib/connection.js:167:10) at Connection._handleNetworkError (/Users/minchankim/Desktop/study/nestToy/node_modules/mysql2/lib/connection.js:180:10) at Socket.emit (node:events:513:28) at Socket.emit (node:domain:489:12) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) { fatal: true } 계속 이렇게 나오는데 npm run db:create 데이터베이스 정보확인 및 dotenv도 재설치 해봤는데 계속 안되서 질문드립니다!버전에 문제가 있나 싶어서 강사님 package.json에서 그대로 불러왔습니다!

  • node.js
  • express
  • nestjs
  • typeorm
dch3030 댓글 1 좋아요 0 조회수 568

querydsl 테스트시 에러입니다.

미해결

실전! Querydsl

<code> 17:02:50.381 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 17:02:50.391 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support .DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 17:02:50.427 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [study.querydsl.QuerydslBasicTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper] 17:02:50.439 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [study.querydsl.QuerydslBasicTest], using SpringBootContextLoader 17:02:50.443 [main] DEBUG org.springframework.test.context.support .AbstractContextLoader - Did not detect default resource location for test class [study.querydsl.QuerydslBasicTest]: class path resource [study/querydsl/QuerydslBasicTest-context.xml] does not exist 17:02:50.444 [main] DEBUG org.springframework.test.context.support .AbstractContextLoader - Did not detect default resource location for test class [study.querydsl.QuerydslBasicTest]: class path resource [study/querydsl/QuerydslBasicTestContext.groovy] does not exist 17:02:50.444 [main] INFO org.springframework.test.context.support .AbstractContextLoader - Could not detect default resource locations for test class [study.querydsl.QuerydslBasicTest]: no resource found for suffixes {-context.xml, Context.groovy}. 17:02:50.445 [main] INFO org.springframework.test.context.support .AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [study.querydsl.QuerydslBasicTest]: QuerydslBasicTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 17:02:50.482 [main] DEBUG org.springframework.test.context.support .ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [study.querydsl.QuerydslBasicTest] 17:02:50.541 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\alita\Desktop\querydsl\querydsl\out\production\classes\study\querydsl\QuerydslApplication.class] 17:02:50.542 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration study.querydsl.QuerydslApplication for test class study.querydsl.QuerydslBasicTest 17:02:50.646 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [study.querydsl.QuerydslBasicTest]: using defaults. 17:02:50.646 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support .DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support .DependencyInjectionTestExecutionListener, org.springframework.test.context.support .DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener] 17:02:50.664 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@3a1dd365, org.springframework.test.context.support .DirtiesContextBeforeModesTestExecutionListener@395b56bb, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@256f8274, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@68044f4, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@52d239ba, org.springframework.test.context.support .DirtiesContextTestExecutionListener@315f43d5, org.springframework.test.context.transaction.TransactionalTestExecutionListener@68fa0ba8, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@6c5945a7, org.springframework.test.context.event.EventPublishingTestExecutionListener@2f05be7f, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@640f11a1, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@5c10f1c3, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@7ac2e39b, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@78365cfa, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@64a8c844, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@3f6db3fb] 17:02:50.668 [main] DEBUG org.springframework.test.context.support .AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@424fd310 testClass = QuerydslBasicTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@1a45193b testClass = QuerydslBasicTest, locations = '{}', classes = '{class study.querydsl.QuerydslApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@1e13529a, org.springframework.boot.test.autoconfigure.properties .PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@93081b6, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@16c069df, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@7c3fdb62, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@4d6025c5, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@80ec1f8], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null]. . ____ _ /\\ / ___'_ __ ( _)_ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.12) 2023-06-26 17:02:51.012 INFO 16528 --- [ main] study.querydsl.QuerydslBasicTest : Starting QuerydslBasicTest using Java 11.0.15 on DESKTOP-UKCCBE9 with PID 16528 (started by alita in C:\Users\alita\Desktop\querydsl\querydsl) 2023-06-26 17:02:51.013 INFO 16528 --- [ main] study.querydsl.QuerydslBasicTest : No active profile set, falling back to 1 default profile: "default" 2023-06-26 17:02:51.530 INFO 16528 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-06-26 17:02:51.544 INFO 16528 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 JPA repository interfaces. 2023-06-26 17:02:52.025 INFO 16528 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2023-06-26 17:02:52.079 INFO 16528 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.15.Final 2023-06-26 17:02:52.234 INFO 16528 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations { 5.1.2.Final } 2023-06-26 17:02:52.480 INFO 16528 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2023-06-26 17:02:52.647 INFO 16528 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2023-06-26 17:02:52.678 INFO 16528 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect 2023-06-26 17:02:53.242 DEBUG 16528 --- [ main] org.hibernate.SQL : alter table member drop foreign key FKcjte2jn9pvo9ud2hyfgwcja0k Hibernate: alter table member drop foreign key FKcjte2jn9pvo9ud2hyfgwcja0k 2023-06-26 17:02:53.256 DEBUG 16528 --- [ main] org.hibernate.SQL : drop table if exists hello Hibernate: drop table if exists hello 2023-06-26 17:02:53.260 DEBUG 16528 --- [ main] org.hibernate.SQL : drop table if exists hibernate_sequence Hibernate: drop table if exists hibernate_sequence 2023-06-26 17:02:53.266 DEBUG 16528 --- [ main] org.hibernate.SQL : drop table if exists member Hibernate: drop table if exists member 2023-06-26 17:02:53.270 DEBUG 16528 --- [ main] org.hibernate.SQL : drop table if exists team Hibernate: drop table if exists team 2023-06-26 17:02:53.275 DEBUG 16528 --- [ main] org.hibernate.SQL : create table hello ( id bigint not null, primary key (id) ) engine=InnoDB Hibernate: create table hello ( id bigint not null, primary key (id) ) engine=InnoDB 2023-06-26 17:02:53.286 DEBUG 16528 --- [ main] org.hibernate.SQL : create table hibernate_sequence ( next_val bigint ) engine=InnoDB Hibernate: create table hibernate_sequence ( next_val bigint ) engine=InnoDB 2023-06-26 17:02:53.296 DEBUG 16528 --- [ main] org.hibernate.SQL : insert into hibernate_sequence values ( 1 ) Hibernate: insert into hibernate_sequence values ( 1 ) 2023-06-26 17:02:53.297 DEBUG 16528 --- [ main] org.hibernate.SQL : create table member ( member_id bigint not null, age integer not null, username varchar(255), team_id bigint, primary key (member_id) ) engine=InnoDB Hibernate: create table member ( member_id bigint not null, age integer not null, username varchar(255), team_id bigint, primary key (member_id) ) engine=InnoDB 2023-06-26 17:02:53.309 DEBUG 16528 --- [ main] org.hibernate.SQL : create table team ( id bigint not null, name varchar(255), primary key (id) ) engine=InnoDB Hibernate: create table team ( id bigint not null, name varchar(255), primary key (id) ) engine=InnoDB 2023-06-26 17:02:53.317 DEBUG 16528 --- [ main] org.hibernate.SQL : alter table member add constraint FKcjte2jn9pvo9ud2hyfgwcja0k foreign key (team_id) references team (id) Hibernate: alter table member add constraint FKcjte2jn9pvo9ud2hyfgwcja0k foreign key (team_id) references team (id) 2023-06-26 17:02:53.342 INFO 16528 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2023-06-26 17:02:53.351 INFO 16528 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2023-06-26 17:02:53.538 WARN 16528 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning 2023-06-26 17:02:54.098 INFO 16528 --- [ main] study.querydsl.QuerydslBasicTest : Started QuerydslBasicTest in 3.391 seconds (JVM running for 4.357) 2023-06-26 17:02:54.207 INFO 16528 --- [ main] o.s.t.c.transaction.TransactionContext : Began transaction (1) for test context [DefaultTestContext@424fd310 testClass = QuerydslBasicTest, testInstance = study.querydsl.QuerydslBasicTest@4504a4ed, testMethod = startQuerydsl@QuerydslBasicTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@1a45193b testClass = QuerydslBasicTest, locations = '{}', classes = '{class study.querydsl.QuerydslApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@1e13529a, org.springframework.boot.test.autoconfigure.properties .PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@93081b6, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@16c069df, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@7c3fdb62, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@4d6025c5, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@80ec1f8], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@250e8712]; rollback [true] 2023-06-26 17:02:54.308 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.328 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.355 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.356 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.359 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.359 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.362 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.363 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.365 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.365 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.367 DEBUG 16528 --- [ main] org.hibernate.SQL : select next_val as id_val from hibernate_sequence for update Hibernate: select next_val as id_val from hibernate_sequence for update 2023-06-26 17:02:54.368 DEBUG 16528 --- [ main] org.hibernate.SQL : update hibernate_sequence set next_val= ? where next_val=? Hibernate: update hibernate_sequence set next_val= ? where next_val=? 2023-06-26 17:02:54.409 INFO 16528 --- [ main] o.s.t.c.transaction.TransactionContext : Rolled back transaction for test: [DefaultTestContext@424fd310 testClass = QuerydslBasicTest, testInstance = study.querydsl.QuerydslBasicTest@4504a4ed, testMethod = startQuerydsl@QuerydslBasicTest, testException = java.lang.NullPointerException, mergedContextConfiguration = [WebMergedContextConfiguration@1a45193b testClass = QuerydslBasicTest, locations = '{}', classes = '{class study.querydsl.QuerydslApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@1e13529a, org.springframework.boot.test.autoconfigure.properties .PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@93081b6, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@16c069df, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@7c3fdb62, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@4d6025c5, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@80ec1f8], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]] java.lang.NullPointerException at study.querydsl.QuerydslBasicTest.startQuerydsl( QuerydslBasicTest.java:57 ) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:62 ) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43 ) at java.base/java.lang.reflect.Method.invoke( Method.java:566 ) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod( ReflectionUtils.java:725 ) at org.junit.jupiter.engine.execution.MethodInvocation.proceed( MethodInvocation.java:60 ) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed( InvocationInterceptorChain.java:131 ) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept( TimeoutExtension.java:149 ) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod( TimeoutExtension.java:140 ) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod( TimeoutExtension.java:84 ) at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0( ExecutableInvoker.java:115 ) at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0( ExecutableInvoker.java:105 ) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed( InvocationInterceptorChain.java:106 ) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed( InvocationInterceptorChain.java:64 ) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke( InvocationInterceptorChain.java:45 ) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke( InvocationInterceptorChain.java:37 ) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke( ExecutableInvoker.java:104 ) at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke( ExecutableInvoker.java:98 ) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7( TestMethodTestDescriptor.java:214 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod( TestMethodTestDescriptor.java:210 ) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute( TestMethodTestDescriptor.java:135 ) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute( TestMethodTestDescriptor.java:66 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$6( NodeTestTask.java:151 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$8( NodeTestTask.java:141 ) at org.junit.platform.engine.support .hierarchical.Node.around( Node.java:137 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$9( NodeTestTask.java:139 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.executeRecursively( NodeTestTask.java:138 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.execute( NodeTestTask.java:95 ) at java.base/java.util.ArrayList.forEach( ArrayList.java:1541 ) at org.junit.platform.engine.support .hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll( SameThreadHierarchicalTestExecutorService.java:41 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$6( NodeTestTask.java:155 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$8( NodeTestTask.java:141 ) at org.junit.platform.engine.support .hierarchical.Node.around( Node.java:137 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$9( NodeTestTask.java:139 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.executeRecursively( NodeTestTask.java:138 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.execute( NodeTestTask.java:95 ) at java.base/java.util.ArrayList.forEach( ArrayList.java:1541 ) at org.junit.platform.engine.support .hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll( SameThreadHierarchicalTestExecutorService.java:41 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$6( NodeTestTask.java:155 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$8( NodeTestTask.java:141 ) at org.junit.platform.engine.support .hierarchical.Node.around( Node.java:137 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.lambda$executeRecursively$9( NodeTestTask.java:139 ) at org.junit.platform.engine.support .hierarchical.ThrowableCollector.execute( ThrowableCollector.java:73 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.executeRecursively( NodeTestTask.java:138 ) at org.junit.platform.engine.support .hierarchical.NodeTestTask.execute( NodeTestTask.java:95 ) at org.junit.platform.engine.support .hierarchical.SameThreadHierarchicalTestExecutorService.submit( SameThreadHierarchicalTestExecutorService.java:35 ) at org.junit.platform.engine.support .hierarchical.HierarchicalTestExecutor.execute( HierarchicalTestExecutor.java:57 ) at org.junit.platform.engine.support .hierarchical.HierarchicalTestEngine.execute( HierarchicalTestEngine.java:54 ) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute( EngineExecutionOrchestrator.java:107 ) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute( EngineExecutionOrchestrator.java:88 ) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0( EngineExecutionOrchestrator.java:54 ) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams( EngineExecutionOrchestrator.java:67 ) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute( EngineExecutionOrchestrator.java:52 ) at org.junit.platform.launcher.core.DefaultLauncher.execute( DefaultLauncher.java:114 ) at org.junit.platform.launcher.core.DefaultLauncher.execute( DefaultLauncher.java:86 ) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute( DefaultLauncherSession.java:86 ) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute( SessionPerRequestLauncher.java:53 ) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs( JUnit5IdeaTestRunner.java:57 ) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute( IdeaTestRunner.java:38 ) at com.intellij.rt.execution.junit.TestsRepeater.repeat( TestsRepeater.java:11 ) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs( IdeaTestRunner.java:35 ) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart( JUnitStarter.java:235 ) at com.intellij.rt.junit.JUnitStarter.main( JUnitStarter.java:54 ) 2023-06-26 17:02:54.428 INFO 16528 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2023-06-26 17:02:54.430 INFO 16528 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2023-06-26 17:02:54.443 INFO 16528 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. Process finished with exit code -1 </code> [질문 내용] QType 활용 2:22초에서 강사님처럼 리팩토링 후 코드 실행시 NullPointer Exception이 발생합니다. 구글 파일 링크입니다. https://drive.google.com/drive/folders/1FxQskkAngeLJcGPtmKUoj-XCmnxm0MVa?usp=sharing

  • java
  • jpa
댓글 1 좋아요 0 조회수 670

p6spy 1.9.0 -> 1.8.1 버전 관련 내용 공유

해결됨

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

p6spy releases를 확인해보면 1.9.0부터 Spring boot 3을 지원한다고 되어있고 테스트시 로그가 안뜹니다. 다른 질문에서보니 해당 버전이 메이븐에서만 지원되어서 그런 듯 합니다. 그래서 바로 아래 버전인 1.8.1을 사용해서 정상적으로 로그가 뜨는 것을 확인했습니다. 그래서 앞으로 최신 버전으로 했을때 안뜬다면 버전을 내려보시면 좋을 것 같습니다.

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
김주영 댓글 1 좋아요 3 조회수 828

포트폴리오 프로젝트

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요, 선생님 강의를 보며 열심히 백엔드 공부중입니다. 혹시 포트폴리오 과제같은 경우는 프론트엔드 코스도 봐야 하나요? 아니면 백엔드 커리큘럼 한에서 만들기가 가능할까요?

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
이하이 댓글 1 좋아요 0 조회수 359

Docker Compose Volumes - postman 조회 오류

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

"Docker Compose Volumes" 강의를 통해 local의 코드를 수정하면 docker 내 image가 nodemon으로인해 refresh되는 것을 cat 명령어로 파일을 열어 확인했습니다. 그런데 코드를 변경 후 13:54에 나온것처럼 local의 콘솔창에 refresh에 대한 로그가 나타나지를 않으며, local에서 postman으로 확인할 때도 코드가 변경되지 않은 것처럼 작동합니다. 뭐가 문제일까요?

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
댓글 1 좋아요 0 조회수 489

wsl2를 사용하여 windows에 ubunto20.04설치

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

아직 프리캠프부분 수강중인데 혹시 완전히 운영체제를 지우지 않고 위와 같은 방식을 사용하면 이후 진도를 나가는데 있어 문제가 생기나요?

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
신정환 댓글 1 좋아요 1 조회수 451

nestjs google login (섹션30과제) 질문

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

선생님 안녕하세요. 구글 소셜로그인 기능에 대해서 과제를 진행하고 있었는데요. 과제 영상에 따라서 따라 내려가고있었는데 nestjs로 REST API를 생성하는데 있어서 refreshToken을 발급해줘야하는 단계에서 res가 에러가 발생합니다. IAuthServiceRefreshToken의 인터페이스에서 res가 없다는 것으로 확인이되는것 같은데요. 이전에 context로 graphql의 인터페이스를 사용해주었었는데 context를 없애고 req로 변경하고 Express의 Response를 생성해주면 REST API가 되는걸까요?! 이전까지 진행했을때는 Icontext를 생성해서 유저를 찾아내는 방식이었는데 강의내용에는 이런게 빠져있어서 어떻게 해나가야 하는지 좀 헷갈리는것 같습니다. 참고내용으로 이전에 사용했던 소스코드들을 공유드려봅니다. //auth.service.ts import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { UsersService } from '../users/users.service'; import * as bcrypt from 'bcrypt'; import { JwtService } from '@nestjs/jwt'; import { IAuthServiceGetAccessToken, IAuthServiceLogin, IAuthServiceRestoreAccessToken, IAuthServiceSetRefreshToken, } from './interfaces/auth-service.interface'; @Injectable() export class AuthService { constructor( private readonly userService: UsersService, // private readonly jwtService: JwtService, ) {} async login({ email, password, context }: IAuthServiceLogin) { // 1. 이메일이 일치하는 유저를 DB에서 찾기 const user = await this.userService.findOneByEmail({ email }); // 2. 일치하는 유저가 없으면?! 에러 던지기!!! if (!user) throw new UnprocessableEntityException('존재하지 않는 이메일입니다.'); // 3. 일치하는 유저가 있지만, 비밀번호가 틀렸다면?! const isAuth = await bcrypt.compare(password, user.password); if (!isAuth) throw new UnprocessableEntityException('틀린 암호입니다.'); // 4. refreshToken(=JWT)을 만들어서 브라우저 쿠키에 저장해서 보내주기 this.setRefreshToken({ user, context }); // 5. 일치하는 유저도 있고, 비밀번호도 맞았다면?! // => accessToken(=JWT)을 만들어서 브라우저에 전달하기 return this.getAccessToken({ user }); } getAccessToken({ user }: IAuthServiceGetAccessToken): string { return this.jwtService.sign( { sub: user.id }, { secret: process.env.JWT_SECRET_KEY, expiresIn: process.env.JWT_ACCESS_TOKEN_EXPIRE, }, ); } setRefreshToken({ user, context }: IAuthServiceSetRefreshToken): void { const refreshToken = this.jwtService.sign( { sub: user.id }, { secret: process.env.JWT_REFRESH_SECRET_KEY, expiresIn: process.env.JWT_REFRESH_TOKEN_EXPIRE, }, ); //개발환경 context.res.setHeader( 'set-Cookie', `lovely soong=${refreshToken}; path=/;`, ); // 배포환경 // context.res.setHeader('set-Cookie', `refreshToken=${refreshToken}; path=/; domain=.mybacksite.com; SameSite=None; Secure; httpOnly`); // context.res.setHeader('Access-Control-Allow-Origin', 'https://myfrontsite.com'); } restoreAccessToken({ user }: IAuthServiceRestoreAccessToken): string { return this.getAccessToken({ user }); } } 확인부탁드리겠습니다 감사합니다.

  • rest-api
  • nestjs
zeler1004 댓글 2 좋아요 0 조회수 704

Entity nullable

해결됨

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

강사님 강의 다 수강 이후 코드를 하나씩 뜯어보며 이해하던 중 엔티티에서 컬럼의 속성 값에 대한 의문ㅇ이 생겨 질문 드립니다. 강사님의 ChannelChats.entity에서 이와 같이 userId와 channelId가 nullable true로 설정이 되어있는데 널값을 허용하는 이유가 궁금하여 질문 드립니다. 그리고 또 다른 질문이 있는데 아래에서 m:1 관계 설정 후 joinColumn만으로도 테이블에 컬럼이 추가되는 걸로 알고 있는데 위에서 Column데코레이터로 다시 한 번 만들어준 것은 후에 select과 같은 요청시 joinColumn만으로 생성된 컬럼 값은 안넘어와서 column 데코레이터를 다시 한 번 사용해준 것이라고 이해해도 괜찮을까요??

  • node.js
  • express
  • nestjs
  • typeorm
이재현 댓글 1 좋아요 0 조회수 365

다대다 관계에서 productTags의 타입에 관한 질문입니다

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요. 항상 알기쉽게 설명해주셔서 많은 도움이되고 있습니다. (myERD프로젝트하는데 거의 일주일 걸린것 같습니다 ㅎㅎ) 섹션29 10-8 다대다 api설계에서 productTags에 대한 질문드립니다. 아래와 같이 tags을 productTags에 넣어서 리턴을 해주는 상황입니다. 그런데 여기서 ...prevTags와 ...newTags.identifiers의 타입이 서로 다른것 같아서 다음과같이 콘솔로 찍어 보았습니다. 배열요소의 3번째까지가 ...prevTags에 담긴 값인데 저렇게 리턴하면 타입관련에러나 DB에 저장이나 서로 연결이 안될줄 알았는데 강의와 같이 잘 작동하였습니다. 그래서 아래와 같이 productTags의 타입인 ProductTag[]도 확인해보았는데도 잘 이해가 안갑니다 제생각에는 prevTags에서 id만 뽑아낸 객체배열을 새로 정의한 다음에 스프레드시켜서 넣어주어야 할것같은데, 해보니 둘 다 결과는 같네요... 제가 어떤 걸 놓치고 있는 걸까요? 사족 : 그런데 이 문제를 생각하는 도중에 힌트를 얻어서 update에서 에러나는 숙제를 해결했습니다^^

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
nya 댓글 1 좋아요 0 조회수 374

http 통신 과제 연습

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

http 과제 연습 graphql-API 문제에 https://practice.codebootcamp.co.kr/graphql 이 안들어가지는데 어디서 해야하나요?

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
이지향 댓글 1 좋아요 0 조회수 402

typeORM Many to one 관계설정

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요 typeORM 관계설정 중에 궁금한게 생겨서 질문드립니다. 공식문서에 나온 코드를 보면 ManyToOne 데코레이터 안에 두 가지 인자가 있는데 앞에 있는건 강의에서도 작성하지만 두번 째인자는 생략이 가능한 것 같네요.. 혹시 두번 째 인자는 OneToMany를 작성할 때도 생략이 가능한가요? 그리고 혹시 OneToMany로 받아오는 배열을 배열말고 count해서 숫자로 칼럼에 넣을 수 있는 방법이 있을까요..? 힌트라도 알려주시면 감사하겠습니다!! @Entity() export class Photo { @PrimaryGeneratedColumn() id: number @Column() url: string @ManyToOne(() => User, (user) => user.photos) user: User }

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
QQ 댓글 1 좋아요 0 조회수 368

스프링 부트3와 카운트 쿼리 분리

해결됨

실전! 스프링 데이터 JPA

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 안녕하세요. 카운트 쿼리 분리 부분을 듣는 도중에 카운트 쿼리에 LEFT JOIN이 사용되는 결과를 확인하기 위해 다음처럼 코드를 작성하였습니다. public interface MemberRepository extends JpaRepository<Member, Long> { @Query(value = "select m from Member m left join m.team t") Page<Member> findByAge(int age, Pageable pageable); ... } @Test public void paging() throws Exception { //given memberRepository.save(new Member("member1", 10)); memberRepository.save(new Member("member2", 10)); memberRepository.save(new Member("member3", 10)); memberRepository.save(new Member("member4", 10)); memberRepository.save(new Member("member5", 10)); //when PageRequest pageRequest = PageRequest.of(0, 3, Sort.by(Sort.Direction.ASC, "username")); Page<Member> page = memberRepository.findByAge(10, pageRequest); //then List<Member> content = page.getContent(); assertThat(content.size()).isEqualTo(3); assertThat(page.getTotalElements()).isEqualTo(5); assertThat(page.getNumber()).isEqualTo(0); assertThat(page.getTotalPages()).isEqualTo(2); assertThat(page.isFirst()).isTrue(); assertThat(page.hasNext()).isTrue(); } 그런데 결과는 강의와는 달리 카운트 쿼리에 LEFT JOIN 이 사용되지 않았고, 심지어 JPQL select m from Member m left join m.team t 을 @Query에 작성했음에도 조회 쿼리도 LEFT JOIN을 사용하지 않은 것을 확인했습니다. 이후 스프링 부트 3 이하 버전에서 동일한 코드로 실행해보니 강의와 동일한 결과를 얻을 수 있었습니다. 스프링 부트 3 부터 적용된 스프링 데이터 JPA 에서는 이러한 부분의 최적화를 자동으로 제공하는 것일까요?

  • java
  • spring
  • spring-boot
  • jpa
조약돌 댓글 1 좋아요 1 조회수 773

자바 공부법

미해결

즐거운 자바

안녕하세요. 백엔드 개발자 희망하고 있습니다. 자바 독학 공부 시작했는데 기본문법 예제들은 혼자 짤 수 있는데 객체지향/3 로또 부분부터 어렵네요. 구구단, 별찍기 하다가 로또 구현할 수 있을때까지 공부 방법이 궁금합니다. ㅠ.ㅠ 자바 공부 방법 알려주세요 ㅠㅠㅠ 지금은 강사님 강의 보고 이해가 부족하다는 부분 이론서 보면서 나가고있습니다. 이론서에 나와있는 문제들도 타이핑 하면서 진행하구 있습니다. 길게 코드 작성할 수 있을때까지 자바 공부 방법 알려주세요.

  • java
  • 자바공부
댓글 2 좋아요 1 조회수 1724

Ubuntu 듀얼부팅

해결됨

[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스

안녕하세요 windows 사용자인데 램 24기가라서 듀얼부팅 메뉴얼대로 우분투 설치했습니다 (재부팅하는데 os 윈도우로 할거냐 우분투로 할거냐 선택창이 안떠서 엄청 헤매다가 유투브 찾아보고 결국 해결했네요 ㅠㅠ) 수업자료에 있는 20.04.4 LTS 버전은 안보여서 비슷한 버전으로 20.04.6 LTS로 설치했는데 문제 없겠죠? 그리고 파티션 할당할 때 c드라이브 용량을 최대한 줄여본다 해서 40기가 정도 우분투 환경에 할당해줬는데 충분할까요? 빠른 답변 주시면 감사하겠습니다!!

  • javascript
  • node.js
  • express
  • docker
  • tdd
  • rest-api
  • nestjs
이하이 댓글 1 좋아요 0 조회수 792

nest-morgan 패키지 사용

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

안녕하세요! 강의 마지막 부분에 nest-morgan 패키지를 사용하면 된다고 하셨는데요. npm 문서를 확인해보니 해당 패키지가 deprecated 되어 있다고 명시돼 있습니다. 혹시 여전히 해당 패키지를 사용하고 계신지 혹은 다른 로그 패키지를 사용하고 계신지 궁금합니다!

  • node.js
  • express
  • nestjs
  • typeorm
seo 댓글 1 좋아요 0 조회수 661

인기 태그

인프런 TOP Writers

주간 인기글