-->
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.  [ 1 post ] 
Author Message
 Post subject: Objekt aus Join erstellen
PostPosted: Wed Jun 21, 2006 4:19 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hallo,

ich habe eine Frage zur Erstellung einer HQL-Query:

Tabelle Sprgrp
Code:
id:
empSprgrpSk

Attribut:
descr
[/b]
Tabelle Acct
Code:
id:
grpAlwAcctSk

fk:
empSprgrpSk

Attribute:
a,b,c,d

Tabelle AcctBal
Code:
id:
AcctBalId

fk:
grpAlwAcctSk

Ich möchte nun (sinngemäß) folgende Abfrage senden, um mir Objekte vom Typ AcctBal zu erstellen:
Code:
from
   Acct gaa,
   AcctBal gaab,
   Sprgrp es
   
where
   es.descr = 'Mitglied'
and
   gaa.grpAlwAcctSk = gaab.id.grpAlwAcctSk
and
   gaa.empSprgrpSk = es.empSprgrpSk
order by
   es.code


So bekomme ich allerdings alle drei Objekte als Ergebnis zurückgeliefert. Mir reicht wie gesagt AcctBal. Wie muss die Query in HQL-Syntax dann aussehen? Ich muss dann wohl die Tabellen aus der From-Clause entfernen. Wie sehen dann aber die Joins aus? Das macht mir Probleme...

Gruß,

a.k.


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

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.