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: Jointure et récupération d'une donnée
PostPosted: Sun Mar 18, 2007 8:50 am 
Newbie

Joined: Sun Mar 18, 2007 8:48 am
Posts: 1
Bonjour,

J'ai une table CD qui contient les colonnes suivantes:
ID_CD
TITLE
SINGER
FK_TYPE


FK_TYPE est une clé étrangère pointant sur la PK de la table CD_TYPE qui contient les colonnes suivantes:
ID_TYPE
TYPE

Dans le modèle objet Java de mon application, j'ai une classe CD qui contient les attributs suivants
ID_CD
TITLE
SINGER
TYPE

On remarque que TYPE (String) n'est pas directement obtenu par la table CD, mais par la jointure avec la table CD_TYPE par la clé étrangère FK_TYPE.

Comment puis-je configurer ce mapping avec les annotations JPA/Hibernate ?
Dois-je utiliser @SecondaryTable ? Où faire cette déclaration ? Au niveau de la classe ? Au niveau de l'attribut TYPE ?

Merci beaucoup de votre aide,

Jean


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 8:46 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Type est une classe java persistante et il y a un lien many-to-one de cd vers type

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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.