FrancMo
FrancMo

Reputation: 2707

Spring boot JPA nnotationException: No identifier specified for entity, while having proper id

I have such DAO:

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.UUID;

@Entity
@Table(name = "questionnaire_answer")
@Getter
@Setter
@NoArgsConstructor
public class QuestionnaireAnswer {

    @Id
    @Column(name = "id", nullable = false)
    private UUID id;

and repository:

@Entity
@Table(name = "questionnaire_answer")
public interface QuestionaireRepository extends CrudRepository<QuestionnaireAnswer, UUID> {

sql:

CREATE TABLE questionnaire_answer (
    id varchar(36) PRIMARY KEY,
...
)

but still I see an error:

AnnotationException: No identifier specified for entity:

what can I do wrong here ?

Blockquote

Upvotes: 0

Views: 38

Answers (1)

FrancMo
FrancMo

Reputation: 2707

eh I am so blind, stupid mistake

@Repository should be in QuestionaireRepository but I put there table and entity :)) it was end of my day.. today I realized what had happened.

Upvotes: 1

Related Questions