1
的,這是我的實體類:代未知列JPA
@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
你檢查了數據庫嗎?你如何生成表格?該列必須在那裏,否則將不存在約束違規 – kostja