I have 2 related tables:
*** database tables account_header - account_id (PK) - account_desc
account_details - account_id (FK) - amount - transaction_date
*** Entity Class
@Entity public class AccountHeader { @id int id; String account_desc;
//getters and setters }
@Entity public class AccountDetails { double amount; Date transaction_date;
//getters and setters }
I have encountered an error that an entity should have an id. How can map this two entities with one-to-many relationship without having a primary key in AccountDetails entity? I have read in some forums that jpa doesnt support an entity without primary key, is that true? if so, is there any way to fix my problem?
Thanks in advance :)
|