-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exception while using @embeddded
PostPosted: Thu Dec 17, 2009 1:54 am 
Newbie

Joined: Fri Jul 03, 2009 1:32 am
Posts: 7
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.