🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: hibernate mapowanie kluczy obcych xml

#143563
From: Jarek
Date: Thu, 08 Jan 2009 23:43
31 lines
1460 bytes
"mk" <mk@mk.pl> wrote in message 
news:gk4i5e$hou$1@atlantis.news.neostrada.pl...
> Witam
>
> Mam pewien kłopot z mapowaniem w hibernate. Są trzy tabele:
>
> [Osoba]
> id
> Nazwisko
> (...)
>
> [Lista]
> id
> nazwa
> uwagi
>
> [Listy]
> id
> fk_id_osoba
> fk_id_lista
>

A po co ci dodatkowe id w tabeli Listy? Kluczem główny mógłby być złożony z 
kolumn fk_id_osoba i fk_id_lista.

Wtedy zamapowałbyś sobie to w hibernate jako zwykłą relację many-to-many - 
nie byłoby encji odpowiadającej tabeli Listy.

Pozdrawiam
Jarek
 
Technical Details
Message-ID: <gk632c$7lf$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <gk4i5e$hou$1@atlantis.news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "Jarek" <nie.ma@takiego.numeru>
Newsgroups: pl.comp.lang.java
Subject: Re: hibernate mapowanie kluczy obcych xml
Date: Fri, 9 Jan 2009 00:43:01 +0100
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 32
Message-ID: <gk632c$7lf$1@inews.gazeta.pl>
References: <gk4i5e$hou$1@atlantis.news.neostrada.pl>
NNTP-Posting-Host: abcj164.neoplus.adsl.tpnet.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1231458189 7855 83.6.225.164 (8 Jan 2009 23:43:09 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Thu, 8 Jan 2009 23:43:09 +0000 (UTC)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
X-Priority: 3
X-Newsreader: Microsoft Windows Live Mail 12.0.1606
X-User: jbojar
X-MSMail-Priority: Normal
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit