Hi, I have two class Voucher and TDTransaction , Voucher calss contain an object of TDTransaction . I have to store data of Voucher to app_voucher table and TDTransaction to app_tdtransaction , for that i coded Voucher class as below
@Entity @Table(name="app_voucher") public class Voucher { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="VOUCHER_ID") private long voucherId; @Embedded @JoinTable( name="dms_tds_transaction", joinColumns = @JoinColumn(name="VOUCHER_ID") private TDTransaction tdsTransaction=new TDTransaction();
}
and TDTransactio
@Embeddable @Table(name="app_tdtransaction") public class TDTransaction {
@ManyToOne(targetEntity=AccountHead.class) @JoinColumn(name="ID") private AccountHead tdsAccountHead;
}
I getting an exception while saving voucher object. Exception is MySQLSyntaxErrorException - Unknown column 'ID' in 'field list' But the column ID is there in my table. Please correct me if the mapping is wrong
thanks and regards Ajil
|