-
Sep 22nd, 2010, 11:08 PM
#1
Help! Having difficulty with Data Access in persistense.
Hi there! Been stuck for a few hours now hoping someone could be of assistance.
Let's say I have a
TABLE A
ID (FK references to PK of TABLE AB)
NAME
DESCRIPTION
AND TABLE AB
ID(PK)
DESCRIPTION
I created an entity bean that maps the values of Table A
so
@Entity
@Table (name="TABLE A")
...
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
public int getId() {
return id;
}
My problem is this. Table A may have 2 IDENTICAL IDs since it is only FK so
1, name_1, hello
1, name_2, hello
but whenever i retrieve their values its always
1, name_1, hello
1, name_1, hello
whenever I execute this
hibernateTemplate.find("from TABLEAClass ");
how do i get
1, name_1, hello
1, name_2, hello?
Any help would greatly be appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules