没有为springJpa中的实体Exception指定标识符

时间:2017-02-07 17:51:06

标签: java spring jpa spring-data-jpa entity

在运行springboot应用程序时,异常即将到来。

引起:org.hibernate.AnnotationException:没有为entity指定标识符:com.model.Location

@Entity
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
@Table(name = "LOCATION", schema = "LOCK")
public class Location implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "LOCATION_ID")
    private int locationId;
    @Column(name = "LOCATION", nullable = false)
    private String location;


    @Column(name = "CREATED_ON", nullable = false)
    private Timestamp CREATED_ON;

    @Column(name = "UPDATED_ON", nullable = false)
    private Timestamp UPDATED_ON;

    /*getter setter methods*/
}

0 个答案:

没有答案