-->
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: Hibernate + SGBR : SQL ----> HQL
PostPosted: Tue Feb 28, 2006 6:29 pm 
Newbie

Joined: Tue Feb 28, 2006 5:54 pm
Posts: 3
Bnjr,

j'ai une base de donnée relationnelle (MySql) dont 2 table :

Code:
     | CategorieProduit                         
     -------------------                             
     | Id                                               
     | Libelle                                         
                                                         

     |   Produit
      ---------------
     |  Id
     |  Designation
     |  Categorie


je fait des test sur Hibernate pour lister les tables et la Maj meme ca roule , Mais mon prb .

je cherche comment lancer une requette HQL qui p me lister les produit avec leur categorie (Jointure * à 1)
N.B : avec le SQL standards c :
Code:
SELECT Produit.Id, Produit.Designation, CategorieProduit.Libelle
FROM CategorieProduit INNER JOIN Produit ON CategorieProduit.Id = Produit.Categorie;

Mais avec HQL j'arrieve po a trouver un exemple opérationnel ?!!!!
et Merci


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 08, 2006 12:02 pm 
Regular
Regular

Joined: Sat May 15, 2004 4:27 am
Posts: 79
Tu peux essayer ça (même si je ne connais pas ton mapping hbn) :

SELECT Prod.id, Prod.designation, Cat.libelle
FROM Produit As Prod
JOIN Prod.categorie As Cat

Tiens nous au courant

@+


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.