-->
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: Need help pls. How to make a JPA Entity without primary key
PostPosted: Tue Jun 26, 2012 10:36 pm 
Newbie

Joined: Tue Jan 31, 2012 11:26 pm
Posts: 3
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 :)


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.