inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

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

h2 버그인가요?

해결됨

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

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 저는 ddl auto를 create로 하고 시퀀스 전략 했을 때, persist 안하고 봐도 시퀀스가 그냥 1, 증가가 50입니다.. 그 다음 persist를 한번 해 봤더니, next value for member_seq를 한번만 호출했습니다. 근데 persist 2번 이상하면, next value for member_seq를 2번 호출합니다. 시퀀스의 현재값도 101번이 됩니다. 뭔가 JPA쪽에서 놓친건가요..? 아니면 제가 뭔가 강의에서 놓친건가요? 그렇게 현재값 101번 만든 후, 이번엔 dll.auto 를 none으로 해서 다시 돌려봤더니 다서 persist 해서 테이블에 저장해서 나온 건 52부터 찍힙니다. persist 안한 것 persist 1번 next value for member_seq 한번 호출 persist 2번 호출 next value for member_seq가 두번 호출 됍니다. 그런데.. 이 상태에서 ddl.auto 를 none으로 하고 다시 한번 로직을 실행해 봤더니.. 어.. 제 생각이 맞다면 101부터 id가 매겨져야 할 것 같은데.. 어.. public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); try{ Member member1 = new Member(); member1.setUsername("A"); Member member2 = new Member(); member2.setUsername("B"); Member member3 = new Member(); member3.setUsername("C"); em.persist(member1); em.persist(member2); // em.persist(member3); tx.commit(); } catch (Exception e){ tx.rollback(); } finally { em.close(); } emf.close(); } 사용 버전 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>jpa-basic</groupId> <artifactId>ex-hello-jpa</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.hibernate.orm</groupId> <artifactId>hibernate-core</artifactId> <version>6.2.9.Final</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.1.214</version> </dependency> </dependencies> </project>

  • java
  • jpa
궁금이 댓글 3 좋아요 1 조회수 967

yarn ios를 해보면

미해결

배달앱 클론코딩 [with React Native]

yarn ios로 시뮬레이터에 앱을 실행하면 빌드도 잘 되는데요. 시뮬레이터에 앱 제목과 Powered by react native 만 하얀 바탕에 뜨고는 앱이 멈춰 있어요. 에러 도 없이요.

  • react-native
sdbang.v 댓글 3 좋아요 0 조회수 454

React Navigation 설치후 에뮬레이터 오류

해결됨

배달앱 클론코딩 [with React Native]

npm i @react-navigation/native npm i @react-navigation/native-stack 설치 후 에뮬레이터를 실행하니 다음과 같은 오류가 나왔습니다 우선 버전 문제인가 싶어서 제로초님 깃 세팅과 똑같이 맞춰 봤지만 해결하지 못했습니다. 다음은 package.json 사진입니다 다음은 메트로와 에뮬 사진과 텍스트입니다. transform[stderr]: Browserslist: caniuse-lite is outdated. Please run: transform[stderr]: npx browserslist@latest --update-db transform[stderr]: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating BUNDLE ./index.js error: SyntaxError: C:\Users\82106\FoodDeliveryApp\node_modules\@react-navigation\native\node_modules\@react-navigation\core\src\types.tsx: Unexpected token, expected "?" (705:52) 703 | [RouteName in keyof ParamList]?: NonNullable< 704 | ParamList[RouteName] > 705 | > extends NavigatorScreenParams<infer T extends {}> | ^ 706 | ? string | PathConfig<T> 707 | : string | Omit<PathConfig<{}>, 'screens' | 'initialRouteName'>; 708 | }; 또한 일반적인 설치가 안되어서 --force로 설치 하였습니다 뭐가 문제일까요 ㅠㅠ

  • react-native
박민규 댓글 1 좋아요 0 조회수 620

ch4부터 시작해야하는데, github에 있는 ch3를 받아 사용해도 에러가 납니다.

미해결

배달앱 클론코딩 [with React Native]

[제로초 강좌 질문 필독 사항입니다] 질문에는 여러분에게 도움이 되는 질문과 도움이 되지 않는 질문이 있습니다. 도움이 되는 질문을 하는 방법을 알려드립니다. https://www.youtube.com/watch?v=PUKOWrOuC0c 이미 ch3까지 강의들으며 폴더를 관리했는데, 이 폴더에 문제가 생겨서 삭제해버렸습니다. 그래서 앞에서 말씀해주신 환경설정(환경변수 등.. )을 따라 npm run android 를 하면 나오는 "Welcome to ReactNative"화면 까지 나오도록 설정은 완료했습니다. 이후, 정확하게 클론받은 폴더에서 ch3의 src폴더와 AppInner파일, App파일을 제가 처음부터 설정한 FoodDeliveryApp폴더에 넣어 사용하는데, 전부 라이브러리를 install 했음에도 이와 같은 에러가 뜹니다. 구글링 한 결과로는 노드 버전의 문제라는데.. 잘 집히지 가 않습니다 정확히 ch4부터 들어야 할 것 같은데 처음부터 강의를 다시 따라가는 수밖에 없을까요? ㅠㅠ

  • react-native
corrosion521 댓글 1 좋아요 0 조회수 393

npm run android 후 번들 에러

해결됨

배달앱 클론코딩 [with React Native]

제로초님 깃에 있는 setting 파일을 클론 해서 만들고 npm run android를 실행하면 우선 다음과 같이 깃 베쉬 에서는 오류 없이 잘됩니다 혹시 모르니 사진과 텍스트 둘다 올리겠습니다 82106@DESKTOP-10F7MVV MINGW64 ~/FoodDeliveryApp $ npm run android > fooddeliveryapp@0.0.1 android > react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 952 file(s) to forward-jetify. Using 12 workers... info Starting JS server... info Launching emulator... info Successfully launched emulator. info Installing the app... > Task :app:installDebug Installing APK 'app-debug.apk' on 'Nexus_5_API_30(AVD) - 11' for app:debug Installed on 1 device. Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 9s 67 actionable tasks: 2 executed, 65 up-to-date info Connecting to the development server... 8081 info Starting the app on "emulator-5554"... Starting: Intent { cmp=com.fooddeliveryapp/.MainActivity } 다음으로는 총 3가지의 프로그램이 열리는데 메트로 서버, 중간은 모르겠습니다 , 에뮬레이터 이런식으로 나옵니다 우선 에뮬레이터는 스크롤이 안되서 메트로 서버 에 나오는 오류만 텍스트로 첨부 하겠습니다 (다음과 같이 오류가 나옵니다) Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:69:19) at Object.createHash (node:crypto:133:10) at stableHash (C:\Users\82106\FoodDeliveryApp\node_modules\metro-cache\src\stableHash.js:19:8) at Object.getCacheKey (C:\Users\82106\FoodDeliveryApp\node_modules\metro-transform-worker\src\index.js:593:7) at getTransformCacheKey (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19) at new Transformer (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\Transformer.js:48:9) at C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\Bundler.js:22:29 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } BUNDLE ./index.js error: TypeError: Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\Bundler.js:48:30) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.transform (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\lib\transformHelpers.js:101:12) at async processModule (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:137:18) at async traverseDependenciesForSingleFile (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:131:3) at async Promise.all (index 0) at async initialTraverseDependencies (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:114:3) at async DeltaCalculator._getChangedDependencies (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:164:25) at async DeltaCalculator.getDelta (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler\DeltaCalculator.js:94:16) at async DeltaBundler.buildGraph (C:\Users\82106\FoodDeliveryApp\node_modules\metro\src\DeltaBundler.js:50:5) 이런식으로 나옵니다 마지막으로 네이티브 폴더의 app/src/build.gradle에도 문제가 있습니다 이런 식으로 인식을 못하는 것 같습니다 apply plugin: "com.android.application" import com.android.build.OutputFile /** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle * bundleAssetName: "index.android.bundle", * * // the entry file for bundle generation. If none specified and * // "index.android.js" exists, it will be used. Otherwise "index.js" is * // default. Can be overridden with ENTRY_FILE environment variable. * entryFile: "index.android.js", * * // https://reactnative.dev/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode * bundleInDebug: false, * * // whether to bundle JS and assets in release mode * bundleInRelease: true, * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants * // The configuration property can be in the following formats * // 'bundleIn${productFlavor}${buildType}' * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, * * // whether to disable dev mode in custom build variants (by default only disabled in release) * // for example: to disable dev mode in the staging build type (if configured) * devDisabledInStaging: true, * // The configuration property can be in the following formats * // 'devDisabledIn${productFlavor}${buildType}' * // 'devDisabledIn${buildType}' * * // the root of your project, i.e. where "package.json" lives * root: "../../", * * // where to put the JS bundle asset in debug mode * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * * // where to put the JS bundle asset in release mode * jsBundleDirRelease: "$buildDir/intermediates/assets/release", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in release mode * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * * // by default the gradle tasks are skipped if none of the JS files or assets change; this means * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ project.ext.react = [ enableHermes: false, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false /** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false); /** * Architectures to build native code for in debug. */ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { applicationId "com.fooddeliveryapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } } buildTypes { debug { signingConfig signingConfigs.debug if (nativeArchitectures) { ndk { abiFilters nativeArchitectures.split(',') } } } release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' } if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } } // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.implementation into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 제가 amd cpu를 사용중이라 그에 맞게 환경 변수도 구글링해서 적용을 해놨는데 혹시 여기에 문제가 있을까요? 우선 환경 변수도 첨부 하겠습니다 마지막으로 현재 안드로이드 스튜디오 sdk 세팅 상태입니다 ㅠㅠ 뭐가 문제 일까요

  • react-native
박민규 댓글 1 좋아요 0 조회수 1159

선생님 (!morning) 부분 질문이 있습니다!

미해결

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

boolean morningCoffee= false if(!morningCoffee){ sout(아이스아메리카노 +!) } sout(주문완료) 논리부정연산자로 !morningCoffee == true 가 되는데 morningCoffee가 false가 맞을때 라고 이해해도 될까요? 헷갈려서 질문남깁니다~!

  • java
가진빵다내놔 댓글 1 좋아요 0 조회수 247

쿠폰 발급을 api로 제공할 경우, client에서 쿠폰 발급 여부를 확인할 수 있는 방법 문의드립니다.

미해결

실습으로 배우는 선착순 이벤트 시스템

안녕하세요. 강의 잘 들었습니다. 강의 들으면서 궁금증이 생겼는데, 만약에 쿠폰 발급 기능을 API로 제공한다고 가정하면 client -> 쿠폰 발급 기능 API 호출이 이루어지고 쿠폰 발급 기능 API에서는 쿠폰 발급 여부를 확인하고 kafka로 produce하게 되는데, 이때는 실제로 쿠폰이 발급된 상태는 아닐 수도 있을 것으로 예상됩니다(실제 쿠폰이 발급되는 시점은 consumer에서 작업이 정상적으로 완료되어야하므로 트래픽이 많거나 하는 경우 시간차이가 더 심할 것으로 예상됩니다) 이러면 쿠폰 발급 기능 API에서 응답값은 어떤 값을 줘야할까요? 쿠폰 발급 여부에서 발급이 가능하다면 쿠폰 발급되는것은 확정이기 때문에 발급되었다는 정보? 쿠폰 발급 여부에서 발급이 가능하지만 추가적으로 polling해서 client 쪽에서 확인하도록 처리? 제가 생각했을땐 위의 2가지정도로 가능할 것 같은데 강사님 의견이 궁금합니다..! 감사합니다.

  • java
  • docker
  • spring-boot
  • kafka
  • redis
예예 댓글 2 좋아요 1 조회수 632

실무에서 @DynamicInsert, @DynamicUpdate 사용하나요?

미해결

실전! 스프링 데이터 JPA

안녕하세요! 좋은 강의 잘 들었습니다! 실무에서 JPA를 사용하면서 궁금한점이 있어서요 실무에서는 @DynamicInsert, @DynamicUpdate 사용하고 있는데 영한님은 한번도 안쓰시더라구요..! 실무에서는 어떻게 사용하시는지 궁금합니다! @DynamicInsert, @DynamicUpdate 사용하지 않으면 어떻게 사용하는지도 궁금합니다.

  • java
  • spring
  • spring-boot
  • jpa
ILoveBackEnd 댓글 2 좋아요 0 조회수 3634

디스코드 접속 안됨..

미해결

틴더 파이어베이스 클론 | 리액트 네이티브

https://discord.com/invite/69JnvkXaAk 2강에서 디스코드 링크에 문제가 있어보이는데요..

  • react-native
  • firebase
hejj 댓글 2 좋아요 2 조회수 911

페치 조인 질문있습니다!

미해결

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

[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예 [질문 내용] 컬렉션의 필요성에 대해 질문 좀 드리겠습니다 - 인프런 | 질문 & 답변 (inflearn.com) 여기서 궁금한 내용있습니다!. 1)"생각하신 내용이 맞습니다. 중간 테이블을 중심으로 조회가 가능하다면 크게 문제가 없습니다. 하지만 때때로 중간 테이블을 중심으로 조회하기 어려운 경우들도 있습니다." 김영한 강사님의 답변 내용 중에 떄떄로 중간 테이블을 중심으로 조회하기 어려운 경우가 어떤 경우인지 구체적으로 알려주실수 있나요?? 일단 다대다=>중간테이블 필요=>성능 최적화 필요하면=>중간테이블에 해당하는 리포지토리 생성후 (Spring data JPA에서) @Query(fetch join)사용하는식으로=> 맨날 이런식으로 했었는데 중간 테이블 중심으로 조회하기 어려운 경우가 어떤 경우인지 궁금합니다. 2)BatchSize를 사용하는 경우 일대다의 일의 collection에 해당하는 다( members) 를 일의 BatchSize에 해당하는만큼 가지고 오지 않습니까? for (Team team : teams) { System.out.println("team:"+team.getName()); for(Member mem:team.getMembers()){ System.out.println(mem.getUsername()); } } 여기서는 성능 최적화가 이해가 됩니다!. team이 붙어있으므로 배치 사이즈만큼만은 mem.getUsername()이 호출되어도 또 그때동안은 쿼리가 안나가니깐요. 근데 궁금한게 IN 쿼리에 들어가는게 BatchSIze만큼의 TeamID인데 연속한 ID만큼 나가는 걸로 알고 있는데 위처럼 연속한 경우는 몰라도, Team을 이것저것 조회하고 그에 대한 member의 메서드를 호출하면 이게 성능상 좋은가요?

  • java
  • jpa
dionisos198 댓글 2 좋아요 1 조회수 582

푸시 알림이 안옵니다ㅠ. [IOS]

해결됨

배달앱 클론코딩 [with React Native]

안녕하세요 강의 잘 듣고 있습니다.! 푸시알림이 안와서 이틀째 삽질중입니다 .ㅠ firebase 클라우드 메시지 테스트로 처음에 한번 알림이 왔었는데 완료할때 푸시 알림이 아예 안옵니다.. server.js 완료 했을때 리턴값 IOS 설정 firebase 버전

  • react-native
데브핑 댓글 1 좋아요 0 조회수 887

h2 버전

해결됨

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

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] start.spring.io 에서 spring boot를 설치하고 h2 버전도 1.4.199로 설치하였습니다. 그러나 아래의 사진과 같이 라이브러리 내에 h2:1.4.199가 아닌 h2:2.1.214가 설치되어 있습니다. 이 부분 때문에 다음 강의에서 제대로 실행이 되지 않는 것 같습니다 .. (MEMBER 테이블 생성이 되지 않음) 왜 이러는 걸까요 ..? 해결 방법도 알려주시면 감사하겠습니다 ㅜ ㅜ

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
kyer 댓글 3 좋아요 0 조회수 534

MEMBER 테이블 생성이 안 됩니다.

해결됨

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

안녕하세요. 강의를 듣고 강의자료까지 참고하며 코드를 작성하였습니다. 그러나 실행창에 create와 drop이 뜨지도 않고 MEMBER 테이블 또한 생성되지 않습니다. 관련 질의를 지금 6시간 넘게 다 찾아보며 (띄어쓰기, @Rollback(false) 추가 등) 해결 시도를 했지만 끝까지 되지 않아 질문 남깁니다 .. [yml 코드] 감사합니다 ..

  • java
  • spring
  • 웹앱
  • spring-boot
  • jpa
kyer 댓글 2 좋아요 1 조회수 569

1:1 연관관계

미해결

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

1:1 연관관계인 두 엔티티가 존재할 경우, 사실 1개의 테이블로 관리할 수 있고, 2개의 테이블 분리해서 관리할 수 있는데, 두 엔티티를 분리하는게 더 나을 것 같아서 2개의 엔티티로 분리하는 걸까요?

  • java
  • jpa
백린이 댓글 1 좋아요 0 조회수 532

JPQL DB 바로 조회

미해결

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

JPQL를 데이터를 조회하면, DB에 먼저 조회한 후, 영속성 컨텍스트에 이미 동일한 엔티티가 있으면, DB에서 조회한 데이터를 버리고, 이미 있는 엔티티를 반환한다고 알고 있습니다. 만약, 기존 엔티티를 새로 검색한 엔티티로 대체한다면, 영속성 컨텍스트에 수정 중인 데이터가 사라질 수 있어, 위험하다고 하는데, 그러면, 조회시 수정 중인 데이터가 조회되어서, 의도치 않는 데이터가 조회될 수 있지 않나요? 오히려 수정 중인 데이터 대신 새로 조회한 데이터로 대체하는게 좋지 않을까 싶은데, 혹시, DB에서 조회한 데이터를 버리고, 이미 있는 엔티티를 반환하는게 더 장점인 구체적인 예시가 있을까요?

  • java
  • jpa
백린이 댓글 2 좋아요 0 조회수 429

31:04 부분 "select o from Order o" 만 했을 경우 결과값

해결됨

실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화

2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms 2023-10-09T19:14:55.660+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 offset ? rows fetch first ? rows only 2023-10-09T19:14:55.662+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495662 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 offset ? rows fetch first ? rows only select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 offset 0 rows fetch first 100 rows only; 2023-10-09T19:14:55.668+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where array_contains(?,m1_0.member_id) 2023-10-09T19:14:55.672+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495672 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select m1_0.member_id,m1_0.city,m1_0.street,m1_0.zipcode,m1_0.name from member m1_0 where array_contains(?,m1_0.member_id) select m1_0.member_id,m1_0.city,m1_0.street,m1_0.zipcode,m1_0.name from member m1_0 where array_contains('ar0: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT)]',m1_0.member_id); 2023-10-09T19:14:55.674+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where array_contains(?,d1_0.id) 2023-10-09T19:14:55.674+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495674 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select d1_0.id,d1_0.city,d1_0.street,d1_0.zipcode,d1_0.status from delivery d1_0 where array_contains(?,d1_0.id) select d1_0.id,d1_0.city,d1_0.street,d1_0.zipcode,d1_0.status from delivery d1_0 where array_contains('ar1: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT)]',d1_0.id); 2023-10-09T19:14:55.676+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.677+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495677 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=1; 2023-10-09T19:14:55.677+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.678+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495678 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=2; 2023-10-09T19:14:55.680+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.order_item_id, o1_0.count, o1_0.item_id, o1_0.order_price from order_item o1_0 where array_contains(?,o1_0.order_id) 2023-10-09T19:14:55.686+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495686 | took 5ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.order_item_id,o1_0.count,o1_0.item_id,o1_0.order_price from order_item o1_0 where array_contains(?,o1_0.order_id) select o1_0.order_id,o1_0.order_item_id,o1_0.count,o1_0.item_id,o1_0.order_price from order_item o1_0 where array_contains('ar2: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL]',o1_0.order_id); 2023-10-09T19:14:55.687+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select i1_0.item_id, i1_0.dtype, i1_0.name, i1_0.price, i1_0.stock_quantity, i1_0.artist, i1_0.etc, i1_0.author, i1_0.isbn, i1_0.actor, i1_0.director from item i1_0 where array_contains(?,i1_0.item_id) 2023-10-09T19:14:55.688+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495688 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select i1_0.item_id,i1_0.dtype,i1_0.name,i1_0.price,i1_0.stock_quantity,i1_0.artist,i1_0.etc,i1_0.author,i1_0.isbn,i1_0.actor,i1_0.director from item i1_0 where array_contains(?,i1_0.item_id) select i1_0.item_id,i1_0.dtype,i1_0.name,i1_0.price,i1_0.stock_quantity,i1_0.artist,i1_0.etc,i1_0.author,i1_0.isbn,i1_0.actor,i1_0.director from item i1_0 where array_contains('ar3: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(4 AS BIGINT)]',i1_0.item_id); 이 결과값에서 강의랑 다른 부분이 있어서 질문 드립니다 하이버네이트 6.2 라서 array_contains 인거 아는데 아래 부분이 이해가 안됩니다. select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.677+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495677 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=1; 2023-10-09T19:14:55.677+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.678+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495678 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=2; orders 를 처음에 조회하고 나서 또 추가적으로 o1_0.delivery_id=? 이걸로 조회하는 결과가 왜 생기는걸까요?.. (배치사이즈도 강의랑 똑같이 100입니다) OrderApiController.java @GetMapping("/api/v3.1/orders") public List<OrderDto> ordersV3_page(@RequestParam(value ="offset",defaultValue = "0") int offset, @RequestParam(value ="limit",defaultValue = "100") int limit) { List<Order> orders = orderRepository.findAllWithMemberDelivery(offset,limit); List<OrderDto> result = orders.stream() .map(o -> new OrderDto(o)) .collect(Collectors.toList()); return result; } OrderRepository.java public List<Order> findAllWithMemberDelivery(int offset, int limit) { return em.createQuery( "select o from Order o" , Order.class ).setFirstResult(offset) .setMaxResults(limit) .getResultList(); } 이렇게 바꾸고 난 이후에 일어난 결과입니당.. 강의랑 In말고도 추가적으로 다른 부분이 있어서 질문드립니다 일단 제 스프링부트 버전은 3.1.3 입니다.

  • java
  • spring
  • spring-boot
  • jpa
ksg980105 댓글 2 좋아요 0 조회수 849

React native nmap 잘못된 클라이언트 ID를 지정 . 콘솔에서 앱 Bundle Identifier를 잘못 등록함

해결됨

배달앱 클론코딩 [with React Native]

pod 'NMapsMap','3.16.0' xcode는 14.2 버전이고 react-native : 0.72.5 버전, NMapsMap은 3.16.0 버전이고 nmap 설치까지는 깃헙 이슈보고 해결했는데 빌드클린하고 빌드 해도 잘못된 클라이언트 ID 지정이라고 계속 나오는데 iOS Bundle Identifier가 인식이 안되는걸까요? 혹시라도 문자 틀렸을까봐 복붙까지했는데 안되네요ㅠ 해결: Xcode에서 Info에 Bundle Identifier를 직접 넣어서 해결했습니다

  • react-native
데브핑 댓글 2 좋아요 0 조회수 842

단방향 설정이 가능한지 궁금합니다!

미해결

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

안녕하세요! 강의영상에서는 가능한 많은 예제를 보여주려고 다양한 연관관계 매핑을 사용했다고 하셨는데 단방향을 지향하는 실무 관점에서 궁금한게 있습니다. Order N:1 Member => 다대일 단방향이 가능한지 OrderItem N:1 Order => 다대일 단방향이 가능한지 Order와 Delivery 관계에서 단방향이 안되는 이유 Item과 Category를 일대다, 다대일로 풀어내는게 맞는지 답변해주시면 감사하겠습니다!!

  • java
  • jpa
양양이 댓글 1 좋아요 0 조회수 315

API_URL 코딩부분이요

해결됨

배달앱 클론코딩 [with React Native]

2강에서 처음으로 POST통신하는 부분에서 아무리 똑같이 코딩해도 네트워크 에러 나서 3시간동안 이것저것 해보다가 방법을 찾았어요 ㅋㅋㅋㅋ 이부분인데 개발툴이 달라서 그런지 모르겠지만 저는 맥북 VS code로 따라하고 있는데 이렇게 하니까 해결됐어요. Config.API_URL이 문자열 변수라서 저기에 ${} 이걸로 감싸면 인식이 안 됐나봐요. 이렇게 삽질하다보면 제꺼가 되겠죠? ㅎㅎㅎ 혹시 저같은 분 계실까봐 글 남깁니당.

  • react-native
sugmug 댓글 1 좋아요 0 조회수 330

버퍼가 비워지는 시점

미해결

Kevin의 알기 쉬운 Spring Reactive Web Applications: Reactor 1부

안녕하세요. Backpressure의 Drop 전략에서 버퍼가 비워질 때까지 Emit된 데이터가 Drop이 된다는 것은 이해했습니다. 그런데 1번 데이터가 subscriber에게 전달되어서 처리가 되면 버퍼에 자리가 한 자리 비게 되는데 왜 데이터가 계속 Drop이 되는건가요? (코드 실습에서 onNext()함수가 호출이 되어도 255,256,257 ~ 1024까지 모두 드랍됨) | 1, 2 | <-------- 3 듣랍 | 2, |. <-------- 4 드랍 (여기서 왜 4번 데이터는 안들어가나요?) | 5, 6 | Buffer DROP-LATEST를 보면 | 1, 2 | <---- 3들어오는 중 버퍼 가득 차서 drop | 2, 4 | <------ 1번이 버퍼에서 나가고 한 자리가 비어서 4번이 들어와짐 이런식으로 동작을 하는데 Drop은 이렇게 동작하지 않는 것 같아 버퍼가 어떻게 동작하는지 궁금하여 질문드립니다.

  • java
  • spring
  • project-reactor
  • webflux
jhjikhsdsdw 댓글 1 좋아요 1 조회수 364

인기 태그

인프런 TOP Writers

주간 인기글