从CSV上传数据时发生问题

时间:2019-09-09 12:42:34

标签: java mysql spring-boot

我必须编写一个从csv文件中获取数据的代码,在进行一些验证后必须将其保存在mysql中。模型类包含两个字段,它们是同一类的参考数据类型。将数据放入数据库时​​,它会引发NULL指针异常

我试图通过创建这两个字段的对象来上载该字段。

@Table(name = "")
public class Employee {

    @Column(name = "")
    private Long Id;

    @Column(name = "name")
    private String name;

    private String description;
    @ManyToOne
    @JoinColumn(name = "", referencedColumnName = "")
    private Employee parent;

    private Double price;

    private Boolean isLeaf = ;


    @OneToMany(mappedBy = "", fetch = )
    private List<Subject> subjectList;


    @ManyToOne
    @JoinColumn(name = "", referencedColumnName = "")
    private Skill topParent;

    private Boolean isDeleted = Boolean.FALSE;
}

必须从csv的层次结构中上传数据

0 个答案:

没有答案