소개
게시글
질문&답변
섹션5 단방향 연관관계 코드쪽에서 DB에 값이 저장되지 않는 오류가 발생합니다.
강사님의 말씀대로 id의 데이터타입으로 야기한 오류였습니다. String에서 Long 으로 타입을 바꾸어 보니 문제가 해결되었습니다. 정말 감사드립니다~~!!!!
- 0
- 5
- 1.4K
질문&답변
섹션5 단방향 연관관계 코드쪽에서 DB에 값이 저장되지 않는 오류가 발생합니다.
위의 사진과 더불어 1월 13, 2021 7:31:18 오후 org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation INFO: HHH000204: Processing PersistenceUnitInfo [name: hello] 1월 13, 2021 7:31:18 오후 org.hibernate.Version logVersion INFO: HHH000412: Hibernate ORM core version 5.4.20.Final 1월 13, 2021 7:31:18 오후 org.hibernate.annotations.common.reflection.java.JavaReflectionManager INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!) 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001005: using driver [org.h2.Driver] at URL [jdbc:h2:tcp://localhost/~/test] 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001001: Connection properties: {password=****, user=sa} 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001003: Autocommit mode: false 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections INFO: HHH000115: Hibernate connection pool size: 20 (min=1) 1월 13, 2021 7:31:19 오후 org.hibernate.dialect.Dialect INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect Hibernate: drop table if exists Member CASCADE Hibernate: drop table if exists Team CASCADE Hibernate: drop sequence if exists hibernate_sequence Hibernate: create sequence hibernate_sequence start with 1 increment by 1 Hibernate: create table Member ( MEMBER_ID bigint not null, TEAM_ID varchar(255), USERNAME varchar(255), primary key (MEMBER_ID) ) Hibernate: create table Team ( teamId varchar(255) not null, name varchar(255), primary key (teamId) ) 1월 13, 2021 7:31:19 오후 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@7c1e32c9] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 1월 13, 2021 7:31:19 오후 org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess@5a2bd7c8] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode. 1월 13, 2021 7:31:19 오후 org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] Hibernate: call next value for hibernate_sequence javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:727) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:707) at hellojpa.JpaMain.main(JpaMain.java:22) Caused by: org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String at org.hibernate.id.IdentifierGeneratorHelper.getIntegralDataTypeHolder(IdentifierGeneratorHelper.java:224) at org.hibernate.id.enhanced.SequenceStructure$1.getNextValue(SequenceStructure.java:98) at org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40) at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:523) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:115) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:185) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:128) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:55) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:721) ... 2 more 1월 13, 2021 7:31:19 오후 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PoolState stop INFO: HHH10001008: Cleaning up connection pool [jdbc:h2:tcp://localhost/~/test] Process finished with exit code 0 이러한 로그가 출력되는 것을 볼 수 있었습니다.
- 0
- 5
- 1.4K
질문&답변
섹션5 단방향 연관관계 코드쪽에서 DB에 값이 저장되지 않는 오류가 발생합니다.
(사진)
- 0
- 5
- 1.4K