生成未知列jpa

时间:2014-01-20 14:00:09

标签: hibernate jpa persistence jpa-2.0

这是我的实体类:

  @Entity
    @Table(name = "EMP_EXPORTATEUR")
    public class EMPExportateur implements Serializable {

        private static final long serialVersionUID = -8981044305302155626L;
        @Id
        //@Basic(optional = false)
        //@NotNull
        @Size(min = 1, max = 19)
        @Column(name = "EXP_CODE")
        private String expCode;
        @Size(max = 255)
        @Column(name = "EXP_NAME")
        private String expName;
        @Embedded
        private AdresseEmbeddable adresse;
        @Embedded
        @AttributeOverrides({
            @AttributeOverride(name = "indicatifPays", column =
                   @Column(name = "TELFIX_COUN_COD")),
            @AttributeOverride(name = "numeroTelephone", column =
                   @Column(name = "TELFIX_NUMBER"))})
        private TelEmbeddable telfixe;
        @Embedded
        @AttributeOverrides({
            @AttributeOverride(name = "indicatifPays", column =
                   @Column(name = "MOBILE_COUN_COD")),
            @AttributeOverride(name = "numeroTelephone", column =
                   @Column(name = "MOBILE_NUMBER"))})
        private TelEmbeddable mobile;
        @Embedded
        @AttributeOverrides({
            @AttributeOverride(name = "indicatifPays", column =
                   @Column(name = "FAX_COUN_COD")),
            @AttributeOverride(name = "numeroTelephone", column =
                   @Column(name = "FAX_NUMBER"))})
        private TelEmbeddable fax;
        @Size(max = 15)
        @Column(name = "EXPORTER_POSTOFFICE_BOX")
        private String chargerpostofficebox;
        @Column(name = "PRIORITE_INTEGRATION")
        private int priority;
        @OneToMany(mappedBy = "exportateur")
        private List<EMPCertEmpotage> certificats;
        @JoinColumn(name = "EXPORTER_COUNTRY", referencedColumnName = "COUNTRYID")
        @ManyToOne
        private CorePays exporterCountry;
        @Size(max = 80)
        @Column(name = "EXPORTER_CITY")
        private String exporterCity;
    //.....
    }

表格将从实体

生成

但是在插入此错误时

  Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("WEBAPP"."EMP_EXPORTATEUR"."NUM_CONT")

我不知道列NUM_CONT

的位置

1 个答案:

答案 0 :(得分:1)

在工作区中搜索EMP_EXPORTATEUR表名,确保不要在任何其他Entity

中使用它