๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #141660

Re: Java Persistence - pytanka

#141660
From: Newion
Date: Thu, 16 Oct 2008 11:41
33 lines
1742 bytes
Dariusz Marcinek napisaล‚(a):


> #### 2
> 
> a) Dlaczego przy jednokierunkowej relacji jeden do wielu:
> 
> ...
> class Person {
> ...
>     @Column(name="ID")
>     private long id;
> 
>     @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
>     @JoinColumn(name="PERSON_ID")
>     private List<Phone> phoneList;
> ...
> }
> 
> przy persistowaniu entity typu Person w encjach Phone z listy,
> pole PERSON_ID w tabeli Phone nie jest ustawiane z id obiektu
> Person? 
> 
> b) Czy jedynym wyjsciem jest tu uzycie relacji dwukierunkowej ?
> 
> #### 3
> 

Moze warto potraktowac Phone w tym przypadku jako komponent i kolekcje phoneList
zamapowac jako kolekcje komponentow.

Pozdrawiam
Pawel
Technical Details
Message-ID: <Xns9B398B45F282Aek029968@213.180.128.149>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
References: <gd5da8$esh$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
From: Newion <newion@o2.pl.invalid>
Newsgroups: pl.comp.lang.java
Subject: Re: Java Persistence - pytanka
Date: Thu, 16 Oct 2008 13:41:27 +0200
Organization: Onet.pl
Lines: 33
Message-ID: <Xns9B398B45F282Aek029968@213.180.128.149>
References: <gd5da8$esh$1@inews.gazeta.pl>
Reply-To: newion@o2.pl.invalid
NNTP-Posting-Host: 109-130.echostar.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1224157283 30965 213.156.109.130 (16 Oct 2008 11:41:23 GMT)
X-Complaints-To: usenet@news.onet.pl
NNTP-Posting-Date: Thu, 16 Oct 2008 11:41:23 +0000 (UTC)
X-Sender: Q8NEzG+VPCULPf8YBpqIyhQr6HcXVqOI
X-Face: #JJ4HGj/XZ::dRSX-ltR)-9<D3X3qlwrbaJGpIhc<\~Cti2?!oXciZ1f*uGSx~Dk2`QbQ-OeDG9YXqkdC(e8kDm+bftsGDoK)N`@O24AQcqLx<E(^bs<P;")Js')4a4cJ"rAl:D7xRyLEf2}`-p@#y0'gpy~#3LhWT9hk&ME>?tcA]@:rcd3I6sFwvd(oM/PQ>6~XLb3
User-Agent: Xnews/2005.10.18
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit