java 不是托管类型实体Skus

ss2ws0br  于 2023-06-28  发布在  Java
关注(0)|答案(1)|浏览(110)

我创建了一个简单的实体,但它给我错误,因为不是托管类型:.entity.Skus

实体类

package <path>.entity;

import jakarta.persistence.Column;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity(name = "skus")
public class Skus extends BaseEntity{
    @Column(name = "name")
    private String name;
}
34gzjxbg

34gzjxbg1#

这是由于进口错误

import javax.persistence.Entity

它需要被替换为
import jakarta.persistence.Entity

相关问题