-->
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: Help Needed Pls.
PostPosted: Wed Dec 21, 2005 5:00 pm 
Beginner
Beginner

Joined: Wed Dec 14, 2005 10:32 am
Posts: 20
Hi All,

I have been trying to acheive the below SQL in Hibernate 3 but could not since a while, I would appreciate any help.

SELECT
cs.id,
cs.num,

cs.line_id,
acc.system_cd,

FROM
table a,
tableb b,
tablecscs cs,
tableacc acc
WHERE
a.num = b.num AND
a.num = cs.num AND
b.code = '5485'
acc.cd = 'S'

First Question I have is: how do I associate all the tables in the where clause in the xml file which habe a foriegn-key relationship and also how do I include the values from clumns in 2 different tables to be in one class.

I have come up with the following simple xml file: but I could not put the foriegn key relationships and I dont know where to start tryied all kinds of things .

Please let me know.

Thanks

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.telcove.phoenix.picc.dao.common.CurrSvcItem" table="tablecs"
dynamic-insert="false"
dynamic-update="false">

<id name="No" type="long" column="NUM" >
<generator class="increment"/>
</id>

<property name="Id">
<column name="ID"/>
</property>
<property name="No">
<column name="num"/>
</property>


</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: sql
PostPosted: Wed Dec 21, 2005 6:39 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
If all you need is to select data from the database, then SQL support in H might you:
http://www.hibernate.org/hib_docs/v3/re ... rysql.html

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.