Regular |
|
Joined: Tue Nov 04, 2003 12:37 pm Posts: 57
|
Hello,
Any expert can teach me how can I define the JPA annotation for OneToOne mapping?
The following is the database table definition:
DOCUMENT ======== ID number(38) primary key NAME varchar(100)
DOCUMENT_DETAIL =============== ID number(38) primary key DOCUMENT_ID number(38) SUBJECT varchar(100)
@Entity @Table(name="DOCUMENT") public class Document { private long id; private String name;
// WHAT is the annotation here private DocumentDetail detail; }
@Entity @Table(name="DOCUMENT_DETAIL") public class DocumentDetail {
private long id; private String subject;
// WHAT is the annotation here private Document document; }
Please teach me, thanks!
|
|