헤르메스 LIFE

[Exception] No identifier specified for entity 본문

Exception

[Exception] No identifier specified for entity

헤르메스의날개 2024. 7. 31. 11:12
728x90

No identifier specified for entity: ezpus.sample.domain.Member

아래와 같은 오류가 발생하였습니다.

Caused by: org.hibernate.AnnotationException: No identifier specified for entity: ezpus.sample.domain.Member

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@NoArgsConstructor
@Getter
@Table(name = "member")
public class Member {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long   id;
    private String name;

    /**
     * @param username
     */
    public Member(String name) {
        this.name = name;
    }
}

import org.springframework.data.annotation.Id가 import되어 있다면, import javax.persistence.Id로 수정하면 됩니다.

728x90