-->
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.  [ 2 posts ] 
Author Message
 Post subject: @OneToOne bi-direction annotation ??
PostPosted: Thu Oct 31, 2013 5:49 am 
Regular
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!


Top
 Profile  
 
 Post subject: Re: @OneToOne bi-direction annotation ??
PostPosted: Thu Oct 31, 2013 8:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 18, 2012 5:03 am
Posts: 36
Location: Fort Wayne, Indiana, USA
http://docs.jboss.org/hibernate/orm/4.2/manual/en-US/html/ch05.html#d5e3628


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

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.