Criteria to suppress the JPA "Persistent entity missing primary key" inspection with @MappedSuperclass?

Answered

Consider the following two classes in the same module:

@MappedSuperclass
public class Foo {
@Id
@GeneratedValue
protected Long id;
}
@Table
@Entity
public class Bar extends Foo {
}

IntelliJ understands that the primary key comes from the superclass, so the inspection does not report a problem.

However, if Foo is moved to another module, the inspection reports that Bar is missing a primary key.

 

Could this be a bug?

0
1 comment

I see that you reported it in https://youtrack.jetbrains.com/issue/IDEA-259624 too. 

Let's continue in YouTrack. 

Thanks. 

0

Please sign in to leave a comment.