在实体的主键上添加注解 @GeneratedValue(strategy=GenerationType.IDENTITY)
@Entity
@Table(name = "OPERATION_LOG")
public class test implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "operation_id")
private Long operationid;
}