inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

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

간단한 주문 조회 V1: 엔티티를 직접 노출

/api/v1/simple-orders에서 무한루프가 발생하지 않고 NullPointerException이 발생합니다.

해결된 질문

779

forest

작성한 질문수 1

0

안녕하세요

강의를 차근차근 듣고 있었는데 /api/v1/simple-orders 단계에서 무한루프가 발생하지 않고 NullPointerException이 발생하여 문의드립니다.

주신 소스코드와 비교해가면서 무엇이 잘못되었는지도 봤는데, 아직 발견을 하지 못했습니다.ㅠㅠ

 

에러코드입니다.

오후 5:06:10: Executing ':JpaShopApplication.main()'...

> Task :compileJava

> Task :processResources UP-TO-DATE

> Task :classes

Note: C:\Users\EUNJEONG\Desktop\github\Inflearn-spring\jpa-shop\src\main\java\jpabook\jpashop\api\MemberApiController.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

> Task :JpaShopApplication.main()

17:06:12.589 [Thread-0] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@2df60ff8

. ____ _

/\\ / ___'_ __ (_)_ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

\\/ ___)| |_)| | | | | || (_| | ) ) ) )

' |____| .__|_| |_|_| |_\__, | / / / /

=========|_|==============|___/=/_/_/_/

:: Spring Boot :: (v2.7.3)

2022-09-02 17:06:13.266 INFO 26936 --- [ restartedMain] jpabook.jpashop.JpaShopApplication : Starting JpaShopApplication using Java 11.0.13 on DESKTOP-QKLC6IA with PID 26936 (C:\Users\EUNJEONG\Desktop\github\Inflearn-spring\jpa-shop\build\classes\java\main started by EUNJEONG in C:\Users\EUNJEONG\Desktop\github\Inflearn-spring\jpa-shop)

2022-09-02 17:06:13.269 INFO 26936 --- [ restartedMain] jpabook.jpashop.JpaShopApplication : No active profile set, falling back to 1 default profile: "default"

2022-09-02 17:06:13.349 INFO 26936 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable

2022-09-02 17:06:13.349 INFO 26936 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'

2022-09-02 17:06:14.884 INFO 26936 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.

2022-09-02 17:06:14.921 INFO 26936 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14 ms. Found 0 JPA repository interfaces.

2022-09-02 17:06:15.891 INFO 26936 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)

2022-09-02 17:06:15.906 INFO 26936 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]

2022-09-02 17:06:15.907 INFO 26936 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]

2022-09-02 17:06:16.036 INFO 26936 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext

2022-09-02 17:06:16.036 INFO 26936 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2687 ms

2022-09-02 17:06:16.248 INFO 26936 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...

2022-09-02 17:06:16.355 INFO 26936 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.

2022-09-02 17:06:16.371 INFO 26936 --- [ restartedMain] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:tcp://localhost/~/jpashop'

2022-09-02 17:06:16.602 INFO 26936 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]

2022-09-02 17:06:16.667 INFO 26936 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.10.Final

2022-09-02 17:06:16.889 INFO 26936 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}

2022-09-02 17:06:16.928 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration boolean -> org.hibernate.type.BooleanType@6403f17a

2022-09-02 17:06:16.928 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration boolean -> org.hibernate.type.BooleanType@6403f17a

2022-09-02 17:06:16.929 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Boolean -> org.hibernate.type.BooleanType@6403f17a

2022-09-02 17:06:16.929 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration numeric_boolean -> org.hibernate.type.NumericBooleanType@353241f7

2022-09-02 17:06:16.930 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration true_false -> org.hibernate.type.TrueFalseType@bf5a83e

2022-09-02 17:06:16.931 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration yes_no -> org.hibernate.type.YesNoType@3f5b85f5

2022-09-02 17:06:16.932 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration byte -> org.hibernate.type.ByteType@38f5bf17

2022-09-02 17:06:16.933 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration byte -> org.hibernate.type.ByteType@38f5bf17

2022-09-02 17:06:16.933 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Byte -> org.hibernate.type.ByteType@38f5bf17

2022-09-02 17:06:16.934 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration character -> org.hibernate.type.CharacterType@13b5e9dc

2022-09-02 17:06:16.934 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration char -> org.hibernate.type.CharacterType@13b5e9dc

2022-09-02 17:06:16.935 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Character -> org.hibernate.type.CharacterType@13b5e9dc

2022-09-02 17:06:16.936 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration short -> org.hibernate.type.ShortType@4c8837e0

2022-09-02 17:06:16.936 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration short -> org.hibernate.type.ShortType@4c8837e0

2022-09-02 17:06:16.936 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Short -> org.hibernate.type.ShortType@4c8837e0

2022-09-02 17:06:16.938 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration integer -> org.hibernate.type.IntegerType@46a8156f

2022-09-02 17:06:16.938 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration int -> org.hibernate.type.IntegerType@46a8156f

2022-09-02 17:06:16.938 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Integer -> org.hibernate.type.IntegerType@46a8156f

2022-09-02 17:06:16.939 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration long -> org.hibernate.type.LongType@459eea7a

2022-09-02 17:06:16.939 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration long -> org.hibernate.type.LongType@459eea7a

2022-09-02 17:06:16.939 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Long -> org.hibernate.type.LongType@459eea7a

2022-09-02 17:06:16.941 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration float -> org.hibernate.type.FloatType@47767afe

2022-09-02 17:06:16.942 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration float -> org.hibernate.type.FloatType@47767afe

2022-09-02 17:06:16.942 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Float -> org.hibernate.type.FloatType@47767afe

2022-09-02 17:06:16.943 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration double -> org.hibernate.type.DoubleType@301e319

2022-09-02 17:06:16.943 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration double -> org.hibernate.type.DoubleType@301e319

2022-09-02 17:06:16.944 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Double -> org.hibernate.type.DoubleType@301e319

2022-09-02 17:06:16.944 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration big_decimal -> org.hibernate.type.BigDecimalType@159c5235

2022-09-02 17:06:16.944 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.math.BigDecimal -> org.hibernate.type.BigDecimalType@159c5235

2022-09-02 17:06:16.945 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration big_integer -> org.hibernate.type.BigIntegerType@36c33a9

2022-09-02 17:06:16.946 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.math.BigInteger -> org.hibernate.type.BigIntegerType@36c33a9

2022-09-02 17:06:16.947 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration string -> org.hibernate.type.StringType@5bec0a89

2022-09-02 17:06:16.947 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.String -> org.hibernate.type.StringType@5bec0a89

2022-09-02 17:06:16.948 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration nstring -> org.hibernate.type.StringNVarcharType@63151175

2022-09-02 17:06:16.948 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration ncharacter -> org.hibernate.type.CharacterNCharType@6a1ec0cb

2022-09-02 17:06:16.949 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration url -> org.hibernate.type.UrlType@5db22bcf

2022-09-02 17:06:16.950 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.net.URL -> org.hibernate.type.UrlType@5db22bcf

2022-09-02 17:06:16.951 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration Duration -> org.hibernate.type.DurationType@2085a190

2022-09-02 17:06:16.951 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.Duration -> org.hibernate.type.DurationType@2085a190

2022-09-02 17:06:16.953 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration Instant -> org.hibernate.type.InstantType@67e6711

2022-09-02 17:06:16.954 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.Instant -> org.hibernate.type.InstantType@67e6711

2022-09-02 17:06:16.955 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration LocalDateTime -> org.hibernate.type.LocalDateTimeType@96c682

2022-09-02 17:06:16.955 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.LocalDateTime -> org.hibernate.type.LocalDateTimeType@96c682

2022-09-02 17:06:16.957 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration LocalDate -> org.hibernate.type.LocalDateType@38afcf3a

2022-09-02 17:06:16.957 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.LocalDate -> org.hibernate.type.LocalDateType@38afcf3a

2022-09-02 17:06:16.958 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration LocalTime -> org.hibernate.type.LocalTimeType@60aaa40

2022-09-02 17:06:16.958 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.LocalTime -> org.hibernate.type.LocalTimeType@60aaa40

2022-09-02 17:06:16.960 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration OffsetDateTime -> org.hibernate.type.OffsetDateTimeType@1803c1d7

2022-09-02 17:06:16.960 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.OffsetDateTime -> org.hibernate.type.OffsetDateTimeType@1803c1d7

2022-09-02 17:06:16.961 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration OffsetTime -> org.hibernate.type.OffsetTimeType@aedc5cc

2022-09-02 17:06:16.961 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.OffsetTime -> org.hibernate.type.OffsetTimeType@aedc5cc

2022-09-02 17:06:16.962 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration ZonedDateTime -> org.hibernate.type.ZonedDateTimeType@7b538446

2022-09-02 17:06:16.963 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.time.ZonedDateTime -> org.hibernate.type.ZonedDateTimeType@7b538446

2022-09-02 17:06:16.964 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration date -> org.hibernate.type.DateType@4ded30b0

2022-09-02 17:06:16.964 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.Date -> org.hibernate.type.DateType@4ded30b0

2022-09-02 17:06:16.965 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration time -> org.hibernate.type.TimeType@27c352e7

2022-09-02 17:06:16.965 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.Time -> org.hibernate.type.TimeType@27c352e7

2022-09-02 17:06:16.966 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration timestamp -> org.hibernate.type.TimestampType@6ea47aa6

2022-09-02 17:06:16.966 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.Timestamp -> org.hibernate.type.TimestampType@6ea47aa6

2022-09-02 17:06:16.966 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.Date -> org.hibernate.type.TimestampType@6ea47aa6

2022-09-02 17:06:16.967 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration dbtimestamp -> org.hibernate.type.DbTimestampType@1841901c

2022-09-02 17:06:16.969 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration calendar -> org.hibernate.type.CalendarType@620b21b6

2022-09-02 17:06:16.969 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.Calendar -> org.hibernate.type.CalendarType@620b21b6

2022-09-02 17:06:16.969 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.GregorianCalendar -> org.hibernate.type.CalendarType@620b21b6

2022-09-02 17:06:16.970 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration calendar_date -> org.hibernate.type.CalendarDateType@1db7f303

2022-09-02 17:06:16.970 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration calendar_time -> org.hibernate.type.CalendarTimeType@7fc72f61

2022-09-02 17:06:16.972 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration locale -> org.hibernate.type.LocaleType@33082bc8

2022-09-02 17:06:16.972 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.Locale -> org.hibernate.type.LocaleType@33082bc8

2022-09-02 17:06:16.974 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration currency -> org.hibernate.type.CurrencyType@309e9cff

2022-09-02 17:06:16.974 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.Currency -> org.hibernate.type.CurrencyType@309e9cff

2022-09-02 17:06:16.975 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration timezone -> org.hibernate.type.TimeZoneType@1fb09ad7

2022-09-02 17:06:16.975 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.TimeZone -> org.hibernate.type.TimeZoneType@1fb09ad7

2022-09-02 17:06:16.976 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration class -> org.hibernate.type.ClassType@42b173ec

2022-09-02 17:06:16.976 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Class -> org.hibernate.type.ClassType@42b173ec

2022-09-02 17:06:16.977 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration uuid-binary -> org.hibernate.type.UUIDBinaryType@9c30afa

2022-09-02 17:06:16.977 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.util.UUID -> org.hibernate.type.UUIDBinaryType@9c30afa

2022-09-02 17:06:16.978 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration uuid-char -> org.hibernate.type.UUIDCharType@71cd9ba1

2022-09-02 17:06:16.979 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration binary -> org.hibernate.type.BinaryType@15cd7c6a

2022-09-02 17:06:16.979 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration byte[] -> org.hibernate.type.BinaryType@15cd7c6a

2022-09-02 17:06:16.979 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration [B -> org.hibernate.type.BinaryType@15cd7c6a

2022-09-02 17:06:16.980 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration wrapper-binary -> org.hibernate.type.WrapperBinaryType@18c9f06c

2022-09-02 17:06:16.980 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration Byte[] -> org.hibernate.type.WrapperBinaryType@18c9f06c

2022-09-02 17:06:16.980 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration [Ljava.lang.Byte; -> org.hibernate.type.WrapperBinaryType@18c9f06c

2022-09-02 17:06:16.981 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration row_version -> org.hibernate.type.RowVersionType@7928f85d

2022-09-02 17:06:16.981 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration image -> org.hibernate.type.ImageType@4e1b40fa

2022-09-02 17:06:16.982 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration characters -> org.hibernate.type.CharArrayType@6aa9a8e8

2022-09-02 17:06:16.982 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration char[] -> org.hibernate.type.CharArrayType@6aa9a8e8

2022-09-02 17:06:16.982 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration [C -> org.hibernate.type.CharArrayType@6aa9a8e8

2022-09-02 17:06:16.983 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration wrapper-characters -> org.hibernate.type.CharacterArrayType@3e2fcf01

2022-09-02 17:06:16.983 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration [Ljava.lang.Character; -> org.hibernate.type.CharacterArrayType@3e2fcf01

2022-09-02 17:06:16.983 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration Character[] -> org.hibernate.type.CharacterArrayType@3e2fcf01

2022-09-02 17:06:16.984 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration text -> org.hibernate.type.TextType@17f9dfd

2022-09-02 17:06:16.985 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration ntext -> org.hibernate.type.NTextType@5f1ea47f

2022-09-02 17:06:16.987 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration blob -> org.hibernate.type.BlobType@5537f97b

2022-09-02 17:06:16.987 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.Blob -> org.hibernate.type.BlobType@5537f97b

2022-09-02 17:06:16.987 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration materialized_blob -> org.hibernate.type.MaterializedBlobType@49a4fbb

2022-09-02 17:06:16.989 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration clob -> org.hibernate.type.ClobType@1586c281

2022-09-02 17:06:16.989 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.Clob -> org.hibernate.type.ClobType@1586c281

2022-09-02 17:06:16.990 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration nclob -> org.hibernate.type.NClobType@728233b8

2022-09-02 17:06:16.990 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.sql.NClob -> org.hibernate.type.NClobType@728233b8

2022-09-02 17:06:16.991 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration materialized_clob -> org.hibernate.type.MaterializedClobType@7f6d685a

2022-09-02 17:06:16.991 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration materialized_nclob -> org.hibernate.type.MaterializedNClobType@3fd21eae

2022-09-02 17:06:16.992 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration serializable -> org.hibernate.type.SerializableType@27a532d1

2022-09-02 17:06:16.996 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration object -> org.hibernate.type.ObjectType@328f6b11

2022-09-02 17:06:16.996 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration java.lang.Object -> org.hibernate.type.ObjectType@328f6b11

2022-09-02 17:06:16.996 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_date -> org.hibernate.type.AdaptedImmutableType@1e18cee7

2022-09-02 17:06:16.996 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_time -> org.hibernate.type.AdaptedImmutableType@1a0eeb9b

2022-09-02 17:06:16.996 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_timestamp -> org.hibernate.type.AdaptedImmutableType@6e299296

2022-09-02 17:06:16.997 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_dbtimestamp -> org.hibernate.type.AdaptedImmutableType@e48566e

2022-09-02 17:06:16.997 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_calendar -> org.hibernate.type.AdaptedImmutableType@56ffdeb6

2022-09-02 17:06:16.997 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_calendar_date -> org.hibernate.type.AdaptedImmutableType@3bc0b5c1

2022-09-02 17:06:16.997 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_binary -> org.hibernate.type.AdaptedImmutableType@19df2d0d

2022-09-02 17:06:16.997 DEBUG 26936 --- [ restartedMain] org.hibernate.type.BasicTypeRegistry : Adding type registration imm_serializable -> org.hibernate.type.AdaptedImmutableType@55e8e37e

2022-09-02 17:06:17.091 INFO 26936 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect

2022-09-02 17:06:17.128 DEBUG 26936 --- [ restartedMain] o.h.type.spi.TypeConfiguration$Scope : Scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration@2913b3fb] to MetadataBuildingContext [org.hibernate.boot.internal.MetadataBuildingContextRootImpl@24490647]

2022-09-02 17:06:17.357 INFO 26936 --- [ restartedMain] org.hibernate.tuple.PojoInstantiator : HHH000182: No default (no-argument) constructor for class: jpabook.jpashop.domain.DeliveryStatus (class must be instantiated by Interceptor)

2022-09-02 17:06:17.563 DEBUG 26936 --- [ restartedMain] org.hibernate.type.EnumType : Using NAMED-based conversion for Enum jpabook.jpashop.domain.OrderStatus

2022-09-02 17:06:17.564 DEBUG 26936 --- [ restartedMain] o.h.type.spi.TypeConfiguration$Scope : Scoping TypeConfiguration [org.hibernate.type.spi.TypeConfiguration@2913b3fb] to SessionFactoryImpl [org.hibernate.internal.SessionFactoryImpl@4ea503a7]

2022-09-02 17:06:18.014 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists category CASCADE

2022-09-02 17:06:18.032 INFO 26936 --- [ restartedMain] p6spy : #1662105978032 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists category CASCADE

drop table if exists category CASCADE ;

2022-09-02 17:06:18.032 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists category_item CASCADE

2022-09-02 17:06:18.033 INFO 26936 --- [ restartedMain] p6spy : #1662105978033 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists category_item CASCADE

drop table if exists category_item CASCADE ;

2022-09-02 17:06:18.033 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists delivery CASCADE

2022-09-02 17:06:18.033 INFO 26936 --- [ restartedMain] p6spy : #1662105978033 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists delivery CASCADE

drop table if exists delivery CASCADE ;

2022-09-02 17:06:18.033 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists item CASCADE

2022-09-02 17:06:18.033 INFO 26936 --- [ restartedMain] p6spy : #1662105978033 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists item CASCADE

drop table if exists item CASCADE ;

2022-09-02 17:06:18.033 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists member CASCADE

2022-09-02 17:06:18.033 INFO 26936 --- [ restartedMain] p6spy : #1662105978033 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists member CASCADE

drop table if exists member CASCADE ;

2022-09-02 17:06:18.033 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists order_item CASCADE

2022-09-02 17:06:18.034 INFO 26936 --- [ restartedMain] p6spy : #1662105978034 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists order_item CASCADE

drop table if exists order_item CASCADE ;

2022-09-02 17:06:18.034 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop table if exists orders CASCADE

2022-09-02 17:06:18.034 INFO 26936 --- [ restartedMain] p6spy : #1662105978034 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop table if exists orders CASCADE

drop table if exists orders CASCADE ;

2022-09-02 17:06:18.034 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

drop sequence if exists hibernate_sequence

2022-09-02 17:06:18.034 INFO 26936 --- [ restartedMain] p6spy : #1662105978034 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop

drop sequence if exists hibernate_sequence

drop sequence if exists hibernate_sequence;

2022-09-02 17:06:18.037 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL : create sequence hibernate_sequence start with 1 increment by 1

2022-09-02 17:06:18.038 INFO 26936 --- [ restartedMain] p6spy : #1662105978038 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create sequence hibernate_sequence start with 1 increment by 1

create sequence hibernate_sequence start with 1 increment by 1;

2022-09-02 17:06:18.038 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table category (

category_id bigint not null,

name varchar(255),

parent_id bigint,

primary key (category_id)

)

2022-09-02 17:06:18.039 INFO 26936 --- [ restartedMain] p6spy : #1662105978039 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table category (

category_id bigint not null,

name varchar(255),

parent_id bigint,

primary key (category_id)

)

create table category (

category_id bigint not null,

name varchar(255),

parent_id bigint,

primary key (category_id)

);

2022-09-02 17:06:18.039 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table category_item (

category_id bigint not null,

item_id bigint not null

)

2022-09-02 17:06:18.039 INFO 26936 --- [ restartedMain] p6spy : #1662105978039 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table category_item (

category_id bigint not null,

item_id bigint not null

)

create table category_item (

category_id bigint not null,

item_id bigint not null

);

2022-09-02 17:06:18.040 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table delivery (

delivery_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

primary key (delivery_id)

)

2022-09-02 17:06:18.040 INFO 26936 --- [ restartedMain] p6spy : #1662105978040 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table delivery (

delivery_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

primary key (delivery_id)

)

create table delivery (

delivery_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

primary key (delivery_id)

);

2022-09-02 17:06:18.040 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table item (

dtype varchar(31) not null,

item_id bigint not null,

name varchar(255),

price integer not null,

stock_quantity integer not null,

artist varchar(255),

etc varchar(255),

author varchar(255),

isbn varchar(255),

actor varchar(255),

director varchar(255),

primary key (item_id)

)

2022-09-02 17:06:18.041 INFO 26936 --- [ restartedMain] p6spy : #1662105978041 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table item (

dtype varchar(31) not null,

item_id bigint not null,

name varchar(255),

price integer not null,

stock_quantity integer not null,

artist varchar(255),

etc varchar(255),

author varchar(255),

isbn varchar(255),

actor varchar(255),

director varchar(255),

primary key (item_id)

)

create table item (

dtype varchar(31) not null,

item_id bigint not null,

name varchar(255),

price integer not null,

stock_quantity integer not null,

artist varchar(255),

etc varchar(255),

author varchar(255),

isbn varchar(255),

actor varchar(255),

director varchar(255),

primary key (item_id)

);

2022-09-02 17:06:18.041 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table member (

member_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

name varchar(255),

primary key (member_id)

)

2022-09-02 17:06:18.042 INFO 26936 --- [ restartedMain] p6spy : #1662105978041 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table member (

member_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

name varchar(255),

primary key (member_id)

)

create table member (

member_id bigint not null,

city varchar(255),

street varchar(255),

zipcode varchar(255),

name varchar(255),

primary key (member_id)

);

2022-09-02 17:06:18.042 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table order_item (

order_item_id bigint not null,

count integer not null,

order_price integer not null,

item_id bigint,

order_id bigint,

primary key (order_item_id)

)

2022-09-02 17:06:18.042 INFO 26936 --- [ restartedMain] p6spy : #1662105978042 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table order_item (

order_item_id bigint not null,

count integer not null,

order_price integer not null,

item_id bigint,

order_id bigint,

primary key (order_item_id)

)

create table order_item (

order_item_id bigint not null,

count integer not null,

order_price integer not null,

item_id bigint,

order_id bigint,

primary key (order_item_id)

);

2022-09-02 17:06:18.042 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

create table orders (

order_id bigint not null,

order_date timestamp,

status varchar(255),

delivery_id bigint,

member_id bigint,

primary key (order_id)

)

2022-09-02 17:06:18.043 INFO 26936 --- [ restartedMain] p6spy : #1662105978043 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

create table orders (

order_id bigint not null,

order_date timestamp,

status varchar(255),

delivery_id bigint,

member_id bigint,

primary key (order_id)

)

create table orders (

order_id bigint not null,

order_date timestamp,

status varchar(255),

delivery_id bigint,

member_id bigint,

primary key (order_id)

);

2022-09-02 17:06:18.043 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table category

add constraint FK2y94svpmqttx80mshyny85wqr

foreign key (parent_id)

references category

2022-09-02 17:06:18.048 INFO 26936 --- [ restartedMain] p6spy : #1662105978048 | took 4ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category

add constraint FK2y94svpmqttx80mshyny85wqr

foreign key (parent_id)

references category

alter table category

add constraint FK2y94svpmqttx80mshyny85wqr

foreign key (parent_id)

references category;

2022-09-02 17:06:18.048 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table category_item

add constraint FKu8b4lwqutcdq3363gf6mlujq

foreign key (item_id)

references item

2022-09-02 17:06:18.049 INFO 26936 --- [ restartedMain] p6spy : #1662105978049 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category_item

add constraint FKu8b4lwqutcdq3363gf6mlujq

foreign key (item_id)

references item

alter table category_item

add constraint FKu8b4lwqutcdq3363gf6mlujq

foreign key (item_id)

references item;

2022-09-02 17:06:18.049 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table category_item

add constraint FKcq2n0opf5shyh84ex1fhukcbh

foreign key (category_id)

references category

2022-09-02 17:06:18.050 INFO 26936 --- [ restartedMain] p6spy : #1662105978050 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table category_item

add constraint FKcq2n0opf5shyh84ex1fhukcbh

foreign key (category_id)

references category

alter table category_item

add constraint FKcq2n0opf5shyh84ex1fhukcbh

foreign key (category_id)

references category;

2022-09-02 17:06:18.050 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table order_item

add constraint FKija6hjjiit8dprnmvtvgdp6ru

foreign key (item_id)

references item

2022-09-02 17:06:18.052 INFO 26936 --- [ restartedMain] p6spy : #1662105978052 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table order_item

add constraint FKija6hjjiit8dprnmvtvgdp6ru

foreign key (item_id)

references item

alter table order_item

add constraint FKija6hjjiit8dprnmvtvgdp6ru

foreign key (item_id)

references item;

2022-09-02 17:06:18.052 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table order_item

add constraint FKt4dc2r9nbvbujrljv3e23iibt

foreign key (order_id)

references orders

2022-09-02 17:06:18.053 INFO 26936 --- [ restartedMain] p6spy : #1662105978053 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table order_item

add constraint FKt4dc2r9nbvbujrljv3e23iibt

foreign key (order_id)

references orders

alter table order_item

add constraint FKt4dc2r9nbvbujrljv3e23iibt

foreign key (order_id)

references orders;

2022-09-02 17:06:18.053 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table orders

add constraint FKtkrur7wg4d8ax0pwgo0vmy20c

foreign key (delivery_id)

references delivery

2022-09-02 17:06:18.055 INFO 26936 --- [ restartedMain] p6spy : #1662105978055 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table orders

add constraint FKtkrur7wg4d8ax0pwgo0vmy20c

foreign key (delivery_id)

references delivery

alter table orders

add constraint FKtkrur7wg4d8ax0pwgo0vmy20c

foreign key (delivery_id)

references delivery;

2022-09-02 17:06:18.055 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

alter table orders

add constraint FKpktxwhj3x9m4gth5ff6bkqgeb

foreign key (member_id)

references member

2022-09-02 17:06:18.055 INFO 26936 --- [ restartedMain] p6spy : #1662105978055 | took 0ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashop

alter table orders

add constraint FKpktxwhj3x9m4gth5ff6bkqgeb

foreign key (member_id)

references member

alter table orders

add constraint FKpktxwhj3x9m4gth5ff6bkqgeb

foreign key (member_id)

references member;

2022-09-02 17:06:18.056 INFO 26936 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]

2022-09-02 17:06:18.063 TRACE 26936 --- [ restartedMain] o.h.type.spi.TypeConfiguration$Scope : Handling #sessionFactoryCreated from [org.hibernate.internal.SessionFactoryImpl@4ea503a7] for TypeConfiguration

2022-09-02 17:06:18.064 INFO 26936 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'

Init1class jpabook.jpashop.InitDb$InitService

2022-09-02 17:06:18.220 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.239 INFO 26936 --- [ restartedMain] p6spy : #1662105978239 | took 10ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.264 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.264 INFO 26936 --- [ restartedMain] p6spy : #1662105978264 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.265 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.266 INFO 26936 --- [ restartedMain] p6spy : #1662105978266 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.266 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.266 INFO 26936 --- [ restartedMain] p6spy : #1662105978266 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.267 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.269 INFO 26936 --- [ restartedMain] p6spy : #1662105978269 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.271 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.272 INFO 26936 --- [ restartedMain] p6spy : #1662105978272 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.272 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.272 INFO 26936 --- [ restartedMain] p6spy : #1662105978272 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.299 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

member

(city, street, zipcode, name, member_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.301 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [서울]

2022-09-02 17:06:18.301 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [1]

2022-09-02 17:06:18.301 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [VARCHAR] - [1111]

2022-09-02 17:06:18.301 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [userA]

2022-09-02 17:06:18.302 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [1]

2022-09-02 17:06:18.304 INFO 26936 --- [ restartedMain] p6spy : #1662105978304 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into member (city, street, zipcode, name, member_id) values (?, ?, ?, ?, ?)

insert into member (city, street, zipcode, name, member_id) values ('서울', '1', '1111', 'userA', 1);

2022-09-02 17:06:18.305 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

item

(name, price, stock_quantity, author, isbn, dtype, item_id)

values

(?, ?, ?, ?, ?, 'B', ?)

2022-09-02 17:06:18.305 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [JPA1 BOOK]

2022-09-02 17:06:18.306 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [10000]

2022-09-02 17:06:18.306 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [100]

2022-09-02 17:06:18.306 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.307 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.307 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [2]

2022-09-02 17:06:18.307 INFO 26936 --- [ restartedMain] p6spy : #1662105978307 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values (?, ?, ?, ?, ?, 'B', ?)

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values ('JPA1 BOOK', 10000, 100, NULL, NULL, 'B', 2);

2022-09-02 17:06:18.307 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

item

(name, price, stock_quantity, author, isbn, dtype, item_id)

values

(?, ?, ?, ?, ?, 'B', ?)

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [JPA2 BOOK]

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [20000]

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [100]

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.308 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [3]

2022-09-02 17:06:18.308 INFO 26936 --- [ restartedMain] p6spy : #1662105978308 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values (?, ?, ?, ?, ?, 'B', ?)

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values ('JPA2 BOOK', 20000, 100, NULL, NULL, 'B', 3);

2022-09-02 17:06:18.309 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

delivery

(city, street, zipcode, delivery_id)

values

(?, ?, ?, ?)

2022-09-02 17:06:18.310 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [서울]

2022-09-02 17:06:18.310 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [1]

2022-09-02 17:06:18.310 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [VARCHAR] - [1111]

2022-09-02 17:06:18.310 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [BIGINT] - [5]

2022-09-02 17:06:18.310 INFO 26936 --- [ restartedMain] p6spy : #1662105978310 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into delivery (city, street, zipcode, delivery_id) values (?, ?, ?, ?)

insert into delivery (city, street, zipcode, delivery_id) values ('서울', '1', '1111', 5);

2022-09-02 17:06:18.311 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

orders

(delivery_id, member_id, order_date, status, order_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.311 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [BIGINT] - [5]

2022-09-02 17:06:18.311 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [1]

2022-09-02 17:06:18.311 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [TIMESTAMP] - [2022-09-02T17:06:18.266087900]

2022-09-02 17:06:18.312 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [ORDER]

2022-09-02 17:06:18.313 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [4]

2022-09-02 17:06:18.314 INFO 26936 --- [ restartedMain] p6spy : #1662105978314 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into orders (delivery_id, member_id, order_date, status, order_id) values (?, ?, ?, ?, ?)

insert into orders (delivery_id, member_id, order_date, status, order_id) values (5, 1, '2022-09-02T17:06:18.266+0900', 'ORDER', 4);

2022-09-02 17:06:18.314 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

order_item

(count, item_id, order_id, order_price, order_item_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.315 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [1]

2022-09-02 17:06:18.315 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [2]

2022-09-02 17:06:18.315 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [4]

2022-09-02 17:06:18.315 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [INTEGER] - [10000]

2022-09-02 17:06:18.315 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [6]

2022-09-02 17:06:18.316 INFO 26936 --- [ restartedMain] p6spy : #1662105978316 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (?, ?, ?, ?, ?)

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (1, 2, 4, 10000, 6);

2022-09-02 17:06:18.316 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

order_item

(count, item_id, order_id, order_price, order_item_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.316 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [2]

2022-09-02 17:06:18.317 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [3]

2022-09-02 17:06:18.317 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [4]

2022-09-02 17:06:18.317 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [INTEGER] - [20000]

2022-09-02 17:06:18.317 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [7]

2022-09-02 17:06:18.317 INFO 26936 --- [ restartedMain] p6spy : #1662105978317 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (?, ?, ?, ?, ?)

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (2, 3, 4, 20000, 7);

2022-09-02 17:06:18.319 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

update

item

set

name=?,

price=?,

stock_quantity=?,

author=?,

isbn=?

where

item_id=?

2022-09-02 17:06:18.320 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [JPA1 BOOK]

2022-09-02 17:06:18.320 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [10000]

2022-09-02 17:06:18.321 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [99]

2022-09-02 17:06:18.321 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.321 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.321 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [2]

2022-09-02 17:06:18.322 INFO 26936 --- [ restartedMain] p6spy : #1662105978322 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

update item set name=?, price=?, stock_quantity=?, author=?, isbn=? where item_id=?

update item set name='JPA1 BOOK', price=10000, stock_quantity=99, author=NULL, isbn=NULL where item_id=2;

2022-09-02 17:06:18.324 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

update

item

set

name=?,

price=?,

stock_quantity=?,

author=?,

isbn=?

where

item_id=?

2022-09-02 17:06:18.324 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [JPA2 BOOK]

2022-09-02 17:06:18.325 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [20000]

2022-09-02 17:06:18.325 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [98]

2022-09-02 17:06:18.325 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.325 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.325 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [3]

2022-09-02 17:06:18.325 INFO 26936 --- [ restartedMain] p6spy : #1662105978325 | took 0ms | statement | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

update item set name=?, price=?, stock_quantity=?, author=?, isbn=? where item_id=?

update item set name='JPA2 BOOK', price=20000, stock_quantity=98, author=NULL, isbn=NULL where item_id=3;

2022-09-02 17:06:18.329 INFO 26936 --- [ restartedMain] p6spy : #1662105978329 | took 0ms | commit | connection 4| url jdbc:h2:tcp://localhost/~/jpashop

;

2022-09-02 17:06:18.331 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.332 INFO 26936 --- [ restartedMain] p6spy : #1662105978332 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.332 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.332 INFO 26936 --- [ restartedMain] p6spy : #1662105978332 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.332 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.333 INFO 26936 --- [ restartedMain] p6spy : #1662105978333 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.333 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.333 INFO 26936 --- [ restartedMain] p6spy : #1662105978333 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.334 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.334 INFO 26936 --- [ restartedMain] p6spy : #1662105978334 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.334 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.335 INFO 26936 --- [ restartedMain] p6spy : #1662105978335 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.336 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

call next value for hibernate_sequence

2022-09-02 17:06:18.337 INFO 26936 --- [ restartedMain] p6spy : #1662105978337 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

call next value for hibernate_sequence

call next value for hibernate_sequence;

2022-09-02 17:06:18.338 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

member

(city, street, zipcode, name, member_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.339 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [진주]

2022-09-02 17:06:18.339 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [2]

2022-09-02 17:06:18.340 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [VARCHAR] - [2222]

2022-09-02 17:06:18.340 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [userB]

2022-09-02 17:06:18.340 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [8]

2022-09-02 17:06:18.340 INFO 26936 --- [ restartedMain] p6spy : #1662105978340 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into member (city, street, zipcode, name, member_id) values (?, ?, ?, ?, ?)

insert into member (city, street, zipcode, name, member_id) values ('진주', '2', '2222', 'userB', 8);

2022-09-02 17:06:18.340 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

item

(name, price, stock_quantity, author, isbn, dtype, item_id)

values

(?, ?, ?, ?, ?, 'B', ?)

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [SPRING1 BOOK]

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [20000]

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [200]

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.341 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [9]

2022-09-02 17:06:18.342 INFO 26936 --- [ restartedMain] p6spy : #1662105978342 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values (?, ?, ?, ?, ?, 'B', ?)

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values ('SPRING1 BOOK', 20000, 200, NULL, NULL, 'B', 9);

2022-09-02 17:06:18.342 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

item

(name, price, stock_quantity, author, isbn, dtype, item_id)

values

(?, ?, ?, ?, ?, 'B', ?)

2022-09-02 17:06:18.342 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [SPRING2 BOOK]

2022-09-02 17:06:18.342 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [40000]

2022-09-02 17:06:18.342 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [300]

2022-09-02 17:06:18.343 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.343 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.343 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [10]

2022-09-02 17:06:18.343 INFO 26936 --- [ restartedMain] p6spy : #1662105978343 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values (?, ?, ?, ?, ?, 'B', ?)

insert into item (name, price, stock_quantity, author, isbn, dtype, item_id) values ('SPRING2 BOOK', 40000, 300, NULL, NULL, 'B', 10);

2022-09-02 17:06:18.344 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

delivery

(city, street, zipcode, delivery_id)

values

(?, ?, ?, ?)

2022-09-02 17:06:18.344 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [진주]

2022-09-02 17:06:18.344 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [VARCHAR] - [2]

2022-09-02 17:06:18.344 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [VARCHAR] - [2222]

2022-09-02 17:06:18.344 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [BIGINT] - [12]

2022-09-02 17:06:18.345 INFO 26936 --- [ restartedMain] p6spy : #1662105978345 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into delivery (city, street, zipcode, delivery_id) values (?, ?, ?, ?)

insert into delivery (city, street, zipcode, delivery_id) values ('진주', '2', '2222', 12);

2022-09-02 17:06:18.345 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

orders

(delivery_id, member_id, order_date, status, order_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.345 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [BIGINT] - [12]

2022-09-02 17:06:18.346 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [8]

2022-09-02 17:06:18.346 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [TIMESTAMP] - [2022-09-02T17:06:18.333837100]

2022-09-02 17:06:18.346 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [ORDER]

2022-09-02 17:06:18.346 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [11]

2022-09-02 17:06:18.347 INFO 26936 --- [ restartedMain] p6spy : #1662105978347 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into orders (delivery_id, member_id, order_date, status, order_id) values (?, ?, ?, ?, ?)

insert into orders (delivery_id, member_id, order_date, status, order_id) values (12, 8, '2022-09-02T17:06:18.333+0900', 'ORDER', 11);

2022-09-02 17:06:18.348 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

order_item

(count, item_id, order_id, order_price, order_item_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.348 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [3]

2022-09-02 17:06:18.348 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [9]

2022-09-02 17:06:18.348 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [11]

2022-09-02 17:06:18.348 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [INTEGER] - [20000]

2022-09-02 17:06:18.348 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [13]

2022-09-02 17:06:18.348 INFO 26936 --- [ restartedMain] p6spy : #1662105978348 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (?, ?, ?, ?, ?)

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (3, 9, 11, 20000, 13);

2022-09-02 17:06:18.349 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

insert

into

order_item

(count, item_id, order_id, order_price, order_item_id)

values

(?, ?, ?, ?, ?)

2022-09-02 17:06:18.349 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [INTEGER] - [4]

2022-09-02 17:06:18.349 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [BIGINT] - [10]

2022-09-02 17:06:18.349 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [BIGINT] - [11]

2022-09-02 17:06:18.349 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [INTEGER] - [40000]

2022-09-02 17:06:18.349 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [BIGINT] - [14]

2022-09-02 17:06:18.350 INFO 26936 --- [ restartedMain] p6spy : #1662105978350 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (?, ?, ?, ?, ?)

insert into order_item (count, item_id, order_id, order_price, order_item_id) values (4, 10, 11, 40000, 14);

2022-09-02 17:06:18.350 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

update

item

set

name=?,

price=?,

stock_quantity=?,

author=?,

isbn=?

where

item_id=?

2022-09-02 17:06:18.352 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [SPRING1 BOOK]

2022-09-02 17:06:18.352 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [20000]

2022-09-02 17:06:18.352 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [197]

2022-09-02 17:06:18.352 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.353 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.353 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [9]

2022-09-02 17:06:18.353 INFO 26936 --- [ restartedMain] p6spy : #1662105978353 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

update item set name=?, price=?, stock_quantity=?, author=?, isbn=? where item_id=?

update item set name='SPRING1 BOOK', price=20000, stock_quantity=197, author=NULL, isbn=NULL where item_id=9;

2022-09-02 17:06:18.354 DEBUG 26936 --- [ restartedMain] org.hibernate.SQL :

update

item

set

name=?,

price=?,

stock_quantity=?,

author=?,

isbn=?

where

item_id=?

2022-09-02 17:06:18.354 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [SPRING2 BOOK]

2022-09-02 17:06:18.354 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [2] as [INTEGER] - [40000]

2022-09-02 17:06:18.354 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [3] as [INTEGER] - [296]

2022-09-02 17:06:18.354 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [4] as [VARCHAR] - [null]

2022-09-02 17:06:18.354 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [5] as [VARCHAR] - [null]

2022-09-02 17:06:18.355 TRACE 26936 --- [ restartedMain] o.h.type.descriptor.sql.BasicBinder : binding parameter [6] as [BIGINT] - [10]

2022-09-02 17:06:18.355 INFO 26936 --- [ restartedMain] p6spy : #1662105978355 | took 0ms | statement | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

update item set name=?, price=?, stock_quantity=?, author=?, isbn=? where item_id=?

update item set name='SPRING2 BOOK', price=40000, stock_quantity=296, author=NULL, isbn=NULL where item_id=10;

2022-09-02 17:06:18.355 INFO 26936 --- [ restartedMain] p6spy : #1662105978355 | took 0ms | commit | connection 5| url jdbc:h2:tcp://localhost/~/jpashop

;

2022-09-02 17:06:18.465 WARN 26936 --- [ restartedMain] 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

2022-09-02 17:06:18.669 INFO 26936 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]

2022-09-02 17:06:18.916 INFO 26936 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729

2022-09-02 17:06:18.966 INFO 26936 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''

2022-09-02 17:06:18.979 INFO 26936 --- [ restartedMain] jpabook.jpashop.JpaShopApplication : Started JpaShopApplication in 6.365 seconds (JVM running for 7.151)

2022-09-02 17:07:07.896 INFO 26936 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'

2022-09-02 17:07:07.897 INFO 26936 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'

2022-09-02 17:07:07.898 INFO 26936 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms

2022-09-02 17:07:07.956 ERROR 26936 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null

at jpabook.jpashop.api.OrderSimpleApiController.ordersV1(OrderSimpleApiController.java:30) ~[main/: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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.22.jar:5.3.22]

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1070) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.22.jar:5.3.22]

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.22.jar:5.3.22]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.65.jar:4.0.FR]

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.22.jar:5.3.22]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.65.jar:4.0.FR]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.22.jar:5.3.22]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.22.jar:5.3.22]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.22.jar:5.3.22]

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.22.jar:5.3.22]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.65.jar:9.0.65]

at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

 

java spring JPA spring-boot

답변 2

0

forest

List<Order> all = orderRepository.findAllByString(new OrderSearch());

30번째 줄은 위와 같습니다.

디버깅을 했더니 all이 null로 나오는 것 같습니다.

강사님께서 올려주신 전체 코드와 몇 번을 비교해봐도 도저히 어느 부분에서 잘못된 것인지 찾지 못하였습니다..

 

코드를 올리겠습니다.

package jpabook.jpashop.api;

import jpabook.jpashop.domain.Order;
import jpabook.jpashop.repository.*;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/** xToOne (ManyToOne, OneToOne)
 * Order
 * Order -> Member
 * Order -> Delivery
 */
@RestController
@RequiredArgsConstructor
public class OrderSimpleApiController {

    private OrderRepository orderRepository;

    @GetMapping("/api/v1/simple-orders")
    public List<Order> ordersV1() {
        List<Order> all = orderRepository.findAllByString(new OrderSearch());
        return all;
    }


}
package jpabook.jpashop.domain.item;

import jpabook.jpashop.domain.Category;
import jpabook.jpashop.exception.NotEnoughStockException;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.BatchSize;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "dtype")
@Getter @Setter
public abstract class Item {

    @Id
    @GeneratedValue
    @Column(name = "item_id")
    private Long id;

    private String name;
    private int price;
    private int stockQuantity;

    @ManyToMany(mappedBy = "items")
    private List<Category> categories = new ArrayList<>();

    //==비즈니스 로직==//
    /**
     * stock 증가
     */
    public void addStock(int quantity) {
        this.stockQuantity += quantity;
    }

    /**
     * stock 감소
     */
    public void removeStock(int quantity) {
        int restStock = this.stockQuantity - quantity;
        if (restStock < 0) {
            throw new NotEnoughStockException("need more stock");
        }
        this.stockQuantity = restStock;
    }
}
package jpabook.jpashop.domain;

import lombok.Getter;

import javax.persistence.Embeddable;

@Embeddable
@Getter
public class Address {

    private String city;
    private String street;
    private String zipcode;

    protected Address() {
    }

    public Address(String city, String street, String zipcode) {
        this.city = city;
        this.street = street;
        this.zipcode = zipcode;
    }
}
package jpabook.jpashop.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import static javax.persistence.FetchType.*;

@Entity
@Getter @Setter
public class Delivery {

    @Id @GeneratedValue
    @Column(name = "delivery_id")
    private Long id;

    //@JsonIgnore
    @OneToOne(mappedBy = "delivery", fetch = LAZY)
    private Order order;

    @Embedded
    private Address address;

    @Enumerated(EnumType.STRING)
    private DeliveryStatus status; //READY, COMP
}
package jpabook.jpashop.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Getter @Setter
public class Member {

    @Id @GeneratedValue
    @Column(name = "member_id")
    private Long id;

    private String name;

    @JsonIgnore
    @Embedded
    private Address address;

    //@JsonIgnore
    @OneToMany(mappedBy = "member")
    private List<Order> orders = new ArrayList<>();

}
package jpabook.jpashop.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import static javax.persistence.FetchType.*;

@Entity
@Table(name = "orders")
@Getter @Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Order {

    @Id @GeneratedValue
    @Column(name = "order_id")
    private Long id;

    @ManyToOne(fetch = LAZY)
    @JoinColumn(name = "member_id")
    private Member member;

    @OneToMany(mappedBy = "order", cascade = CascadeType.ALL)
    private List<OrderItem> orderItems = new ArrayList<>();

    @OneToOne(fetch = LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name = "delivery_id")
    private Delivery delivery;

    private LocalDateTime orderDate; //주문시간

    @Enumerated(EnumType.STRING)
    private OrderStatus status; //주문상태 [ORDER, CANCEL]

    //==연관관계 메서드==//
    public void setMember(Member member) {
        this.member = member;
        member.getOrders().add(this);
    }

    public void addOrderItem(OrderItem orderItem) {
        orderItems.add(orderItem);
        orderItem.setOrder(this);
    }

    public void setDelivery(Delivery delivery) {
        this.delivery = delivery;
        delivery.setOrder(this);
    }

    //==생성 메서드==//
    public static Order createOrder(Member member, Delivery delivery, OrderItem... orderItems) {
        Order order = new Order();
        order.setMember(member);
        order.setDelivery(delivery);
        for (OrderItem orderItem : orderItems) {
            order.addOrderItem(orderItem);
        }
        order.setStatus(OrderStatus.ORDER);
        order.setOrderDate(LocalDateTime.now());
        return order;
    }

    //==비즈니스 로직==//
    /**
     * 주문 취소
     */
    public void cancel() {
        if (delivery.getStatus() == DeliveryStatus.COMP) {
            throw new IllegalStateException("이미 배송완료된 상품은 취소가 불가능합니다.");
        }

        this.setStatus(OrderStatus.CANCEL);
        for (OrderItem orderItem : orderItems) {
            orderItem.cancel();
        }
    }

    //==조회 로직==//
    /**
     * 전체 주문 가격 조회
     */
    public int getTotalPrice() {
        int totalPrice = 0;
        for (OrderItem orderItem : orderItems) {
            totalPrice += orderItem.getTotalPrice();
        }
        return totalPrice;
    }

}
package jpabook.jpashop.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jpabook.jpashop.domain.item.Item;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;

import static javax.persistence.FetchType.*;

@Entity
@Getter @Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class OrderItem {

    @Id @GeneratedValue
    @Column(name = "order_item_id")
    private Long id;

    @ManyToOne(fetch = LAZY)
    @JoinColumn(name = "item_id")
    private Item item;

    //@JsonIgnore
    @ManyToOne(fetch = LAZY)
    @JoinColumn(name = "order_id")
    private Order order;

    private int orderPrice; //주문 가격
    private int count; //주문 수량

    //==생성 메서드==//
    public static OrderItem createOrderItem(Item item, int orderPrice, int count) {
        OrderItem orderItem = new OrderItem();
        orderItem.setItem(item);
        orderItem.setOrderPrice(orderPrice);
        orderItem.setCount(count);

        item.removeStock(count);
        return orderItem;
    }

    //==비즈니스 로직==//
    public void cancel() {
        getItem().addStock(count);
    }

    //==조회 로직==//

    /**
     * 주문상품 전체 가격 조회
     */
    public int getTotalPrice() {
        return getOrderPrice() * getCount();
    }
}
package jpabook.jpashop.repository;

import jpabook.jpashop.domain.item.Item;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;
import java.util.List;

@Repository
@RequiredArgsConstructor
public class ItemRepository {
    private final EntityManager em;

    public void save(Item item) {
        if (item.getId()==null){ // id가 없음 -> 새로 등록
            em.persist(item);
        } else {
            em.merge(item);
        }
    }

    public Item findOne(Long id) {
        return em.find(Item.class, id);
    }

    public List<Item> findAll() {
        return em.createQuery("select i from Item i", Item.class)
                .getResultList();
    }
}
package jpabook.jpashop.repository;

import jpabook.jpashop.domain.Member;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

@Repository
@RequiredArgsConstructor
public class MemberRepository {

    private final EntityManager em;

    public void save(Member member) {
        em.persist(member);
    }

    public Member findOne(Long id) {
        return em.find(Member.class, id);
    }

    public List<Member> findAll() {
        return em.createQuery("select m from Member m", Member.class)
                .getResultList();
    }

    public List<Member> findByName(String name) {
        return em.createQuery("select m from Member m where m.name=:name", Member.class)
                .setParameter("name", name)
                .getResultList();
    }
}
package jpabook.jpashop.repository;

import jpabook.jpashop.domain.Order;

import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.*;
import java.util.ArrayList;
import java.util.List;

@Repository
public class OrderRepository {

    private final EntityManager em;

    public OrderRepository(EntityManager em) {
        this.em = em;
    }

    public void save(Order order) {
        em.persist(order);
    }

    public Order findOne(Long id) {
        return em.find(Order.class, id);
    }

    public List<Order> findAll() {
        return em.createQuery("select o from Order o", Order.class)
                .getResultList();
    }

    public List<Order> findAllByString(OrderSearch orderSearch) {

        String jpql = "select o from Order o join o.member m";
        boolean isFirstCondition = true;

        //주문 상태 검색
        if (orderSearch.getOrderStatus() != null) {
            if (isFirstCondition) {
                jpql += " where";
                isFirstCondition = false;
            } else {
                jpql += " and";
            }
            jpql += " o.status = :status";
        }

        //회원 이름 검색
        if (StringUtils.hasText(orderSearch.getMemberName())) {
            if (isFirstCondition) {
                jpql += " where";
                isFirstCondition = false;
            } else {
                jpql += " and";
            }
            jpql += " m.name like :name";
        }

        TypedQuery<Order> query = em.createQuery(jpql, Order.class)
                .setMaxResults(1000);

        if (orderSearch.getOrderStatus() != null) {
            query = query.setParameter("status", orderSearch.getOrderStatus());
        }
        if (StringUtils.hasText(orderSearch.getMemberName())) {
            query = query.setParameter("name", orderSearch.getMemberName());
        }

        return query.getResultList();
    }

    /**
     * JPA Criteria
     */
    public List<Order> findAllByCriteria(OrderSearch orderSearch) {
        CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<Order> cq = cb.createQuery(Order.class);
        Root<Order> o = cq.from(Order.class);
        Join<Object, Object> m = o.join("member", JoinType.INNER);

        List<Predicate> criteria = new ArrayList<>();

        //주문 상태 검색
        if (orderSearch.getOrderStatus() != null) {
            Predicate status = cb.equal(o.get("status"), orderSearch.getOrderStatus());
            criteria.add(status);
        }
        //회원 이름 검색
        if (StringUtils.hasText(orderSearch.getMemberName())) {
            Predicate name =
                    cb.like(m.<String>get("name"), "%" + orderSearch.getMemberName() + "%");
            criteria.add(name);
        }

        cq.where(cb.and(criteria.toArray(new Predicate[criteria.size()])));
        TypedQuery<Order> query = em.createQuery(cq).setMaxResults(1000);
        return query.getResultList();
    }

}
package jpabook.jpashop.service;

import jpabook.jpashop.domain.*;
import jpabook.jpashop.domain.item.Item;
import jpabook.jpashop.repository.ItemRepository;
import jpabook.jpashop.repository.MemberRepository;
import jpabook.jpashop.repository.OrderRepository;
import jpabook.jpashop.repository.OrderSearch;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class OrderService {

    private final OrderRepository orderRepository;
    private final MemberRepository memberRepository;
    private final ItemRepository itemRepository;

    /**
     * 주문
     */
    @Transactional
    public Long order(Long memberId, Long itemId, int count) {

        //엔티티 조회
        Member member = memberRepository.findOne(memberId);
        Item item = itemRepository.findOne(itemId);

        //배송정보 생성
        Delivery delivery = new Delivery();
        delivery.setAddress(member.getAddress());
        delivery.setStatus(DeliveryStatus.READY);

        //주문상품 생성
        OrderItem orderItem = OrderItem.createOrderItem(item, item.getPrice(), count);

        //주문 생성
        Order order = Order.createOrder(member, delivery, orderItem);

        //주문 저장
        orderRepository.save(order);

        return order.getId();
    }

    /**
     * 주문 취소
     */
    @Transactional
    public void cancelOrder(Long orderId) {
        //주문 엔티티 조회
        Order order = orderRepository.findOne(orderId);
        //주문 취소
        order.cancel();
    }

    //검색
    public List<Order> findOrders(OrderSearch orderSearch) {
        return orderRepository.findAllByString(orderSearch);
    }
}
package jpabook.jpashop;

import jpabook.jpashop.domain.*;
import jpabook.jpashop.domain.item.Book;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;

/**
 * 종 주문 2개
 * * userA
 *      * JPA1 BOOK
 *      * JPA2 BOOK
 * * userB
 *      * SPRING1 BOOK
 *      * SPRING2 BOOK
 */
@Component
@RequiredArgsConstructor
public class InitDb {

    private final InitService initService;

    @PostConstruct
    public void init() {
        initService.dbInit1();
        initService.dbInit2();
    }

    @Component
    @Transactional
    @RequiredArgsConstructor
    static class InitService {

        private final EntityManager em;

        public void dbInit1() {
            System.out.println("Init1" + this.getClass());
            Member member = createMember("userA", "서울", "1", "1111");
            em.persist(member);

            Book book1 = createBook("JPA1 BOOK", 10000, 100);
            em.persist(book1);

            Book book2 = createBook("JPA2 BOOK", 20000, 100);
            em.persist(book2);

            OrderItem orderItem1 = OrderItem.createOrderItem(book1, 10000, 1);
            OrderItem orderItem2 = OrderItem.createOrderItem(book2, 20000, 2);

            Delivery delivery = createDelivery(member);
            Order order = Order.createOrder(member, delivery, orderItem1, orderItem2);
            em.persist(order);
        }

        public void dbInit2() {
            Member member = createMember("userB", "진주", "2", "2222");
            em.persist(member);

            Book book1 = createBook("SPRING1 BOOK", 20000, 200);
            em.persist(book1);

            Book book2 = createBook("SPRING2 BOOK", 40000, 300);
            em.persist(book2);

            OrderItem orderItem1 = OrderItem.createOrderItem(book1, 20000, 3);
            OrderItem orderItem2 = OrderItem.createOrderItem(book2, 40000, 4);

            Delivery delivery = createDelivery(member);
            Order order = Order.createOrder(member, delivery, orderItem1, orderItem2);
            em.persist(order);
        }

        private Member createMember(String name, String city, String street, String zipcode) {
            Member member = new Member();
            member.setName(name);
            member.setAddress(new Address(city, street, zipcode));
            return member;
        }

        private Book createBook(String name, int price, int stockQuantity) {
            Book book1 = new Book();
            book1.setName(name);
            book1.setPrice(price);
            book1.setStockQuantity(stockQuantity);
            return book1;
        }

        private Delivery createDelivery(Member member) {
            Delivery delivery = new Delivery();
            delivery.setAddress(member.getAddress());
            return delivery;
        }
    }
}
package jpabook.jpashop;

import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class JpaShopApplication {

   public static void main(String[] args) {
      SpringApplication.run(JpaShopApplication.class, args);
   }

}

 

 

 

0

David

전체 프로젝트를 압축해서 구글 드라이브로 공유해서 링크를 남겨주세요.
구글 드라이브 업로드 방법은 다음을 참고해주세요.

https://bit.ly/3fX6ygx

주의
: 업로드시 권한 문제 꼭 확인해주세요

추가로 다음 내용도 코멘트 부탁드립니다.

1. 실행 방법을 알려주세요.
2. 어떻게 문제를 확인할 수 있는지 자세한 설명을 남겨주세요.

감사합니다

0

forest

https://drive.google.com/file/d/1OZpbEsy6P8HOxo1yzPOa3arLXnV4uuD3/view?usp=sharing

구글 드라이브 링크입니다.

  1. build.gradle 을 눌러 프로젝트로 열면 됩니다.

  2. JpaShopApplication을 실행시킨 후 postman에서 http://localhost:8080/api/v1/simple-orders 을 GET 방식으로 보내어 확인하면 됩니다.

감사합니다.

0

David

올려주신 프로젝트 파일을 다운 받으면 Window Defender에서 바이러스를 탐지합니다.

image

바이러스 검사를 진행하신 뒤 다시 올려주실 수 있으실까요?

0

forest

https://drive.google.com/file/d/1JGCJ10lxI0ww6Al_nJag0wJaWD12V_aJ/view?usp=sharing

다시 올렸습니다!

0

David

동일한 증상입니다.

바이러스 검출 파일이 build 폴더 내에 존재하는데, 번거로우시겠지만 build 폴더를 완전시 삭제하신 후 다시 올려주실 수 있으실까요?

image

0

forest

https://drive.google.com/file/d/1gLCGQ-wNO5hJnAvTzpxmViDCudt1bw7b/view?usp=sharing

build폴더 삭제 후 다시 올렸습니다!

0

David

image

RequiredArgsConstructor가 동작하는 기준은 private final이 붙은 필드입니다.

final 키워드가 없어서 OrderRepository 자체가 주입 되지 않았습니다.

final 키워드를 붙이시고 다시 실행해주세요.

0

forest

다른 데 신경쓰느라 기본적인 부분을 놓치고 있었네요ㅠㅠ

정말 감사드립니다!!!

0

David

안녕하세요. forest님, 공식 서포터즈 David입니다.

java.lang.NullPointerException: null at jpabook.jpashop.api.OrderSimpleApiController.ordersV1(OrderSimpleApiController.java:30)

컨트롤러쪽 30번째 줄에서 npe가 터졌는데, 디버깅하셔서 orderRepository, all 등이 null이 아닌지 확인해주세요.

작성하신 코드도 함께 올려주시면 상세한 답변에 큰 도움이 됩니다.

감사합니다.

@JsonIgnore 이후 Internal Server Error가 발생하지 않습니다.

0

34

2

강의 관련 외 질문입니다.

0

91

2

SpringBoot4 + Hibernate7 모듈 등록 방법 공유

1

114

1

BeanCreationException

0

105

3

Update 후 UpdateMemberResponse 매핑할 때

0

66

1

트랜잭션을 사용 안 할 때 커넥션은 언제 가져오나요?

0

113

2

페이징 + 검색조건 관련해서 질문드립니다.

0

79

1

Query Dsl Q파일 질문입니다.

0

93

1

루트 쿼리라는것은

0

69

1

메서드를 분리하는 기준

0

77

1

findAllWithMemberDelivery 메서드 질문드립니다.

0

126

3

연관관계 매핑을 안 쓸 경우, 사용해야 하는 전략

0

98

2

fetch join과 영속화와 OSIV의 관계

0

104

2

Distinct 사용 전 결과에 대한 의문

0

127

2

레포지토리 계층에서의 트랜잭션에 대한 의문

0

66

1

영속성 컨텍스트 생명주기의 신기한 부분이 있습니다.

0

86

2

dto 필드 속 엔티티 여부

0

71

1

뷰템플릿 사용 시

0

88

2

Result 클래스 관련 질문

0

60

1

@PostConstruct 프록시 관련 질문드립니다

0

91

1

DTO 대신 Form 사용은 안되나요?

0

144

1

OSIV ON 상태일 때

0

102

1

fetch join VS fetch join 페이징 궁금증

0

196

2

양방향 연관관계 알아보는 법?

0

113

1