org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String
맀μ₯ ν
μ΄λΈ μμ½ μλΉμ€λ₯Ό ꡬν μ€ μλ¬κ° λ°μνμ΅λλ€.
ν΄λΉ μλ¬μ λν΄ μμλ³΄κ² μ΅λλ€.
org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:362) ~[spring-orm-5.3.27.jar:5.3.27]
at com.sun.proxy.$Proxy113.merge(Unknown Source) ~[na: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.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:315) ~[spring-orm-5.3.27.jar:5.3.27]
at com.sun.proxy.$Proxy113.merge(Unknown Source) ~[na:na]
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:669) ~[spring-data-jpa-2.7.12.jar:2.7.12]
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.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:289) ~[spring-data-commons-2.7.12.jar:2.7.12]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137) ~[spring-data-commons-2.7.12.jar:2.7.12]
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121) ~[spring-data-commons-2.7.12.jar:2.7.12]
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:530) ~[spring-data-commons-2.7.12.jar:2.7.12]
...
hibernate.id.IdentifierGenerationException
, μ¦ hibernateμ id κ΄λ ¨ν΄μ μλ¬κ° λ°μνμ΅λλ€.
java.lang.String
κ΄λ ¨ν΄μ μλ¬κ° λ°μνλ€λ κ²μ Generation
κ°μ String
μΌλ‘ μμ±νκΈ° λλ¬Έμ λ°μνμ΅λλ€.
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
public class Member extends BaseEntity {
@Id
@GeneratedValue
private String id;
private String email;
private String phone;
private String nickname;
private String password;
@Enumerated(EnumType.STRING)
private MemberStatus memberStatus;
@Enumerated(EnumType.STRING)
private MemberType memberType;
private LocalDateTime registeredAt;
private LocalDateTime unRegisteredAt;
}
id
λ userId
λ‘ μμ±νμ§λ§ @GeneratedValue
μ΄λ
Έν
μ΄μ
μ μμ±ν΄μ λ°μν μ€λ₯μμ΅λλ€.
ν λ² μμ±ν λ μ§μ€νμ!(μκΎΈ μ΄λ¬λ©΄ μμν΄..)