-->
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.  [ 3 posts ] 
Author Message
 Post subject: how can i do query in many to one?save me,thanks.
PostPosted: Sun Jul 11, 2004 11:57 pm 
Newbie

Joined: Sun Jul 11, 2004 11:43 pm
Posts: 9
hi,every body,I have some trouble in query ,my mapping config is the text under
==========================================
<class name="cmssweb.po.TSp" table="T_SP">
<id column="SP_PHONE" name="spPhone" type="string">
<generator class="uuid.string"/>
</id>
<property column="SP_NAME" length="20" name="spName" not-null="true" type="string"/>
<property column="SP_CODE" length="6" name="spCode" not-null="true" type="integer"/>
<property column="PHONE" length="20" name="phone" not-null="true" type="string"/>
<property column="NET_ADDR" length="100" name="netAddr" not-null="true" type="string"/>
<property column="DESCRIPTION" length="550" name="description" type="string"/>
</class>
<class name="cmssweb.po.TService" table="T_SERVICE">
<composite-id>
<key-property column="DSERVICE_ID" length="20" name="dserviceId" type="string"/>
<key-property column="SERVICE_ID" length="10" name="serviceId" type="string"/>
<key-property column="SP_PHONE" length="5" name="spPhone" type="string"/>
</composite-id>
<many-to-one
name="tsp"
class="cmssweb.po.TSp"
column="SP_PHONE"
not-null="false"
unique="false"
cascade="none"
outer-join="auto"
update="false"
insert="false"
/>
<property column="SERVICE_NAME" length="20" name="serviceName" not-null="true" type="string"/>
<property column="SERVICE_CODE" length="24" name="serviceCode" type="string"/>
<property column="BILLING_MODE" length="1" name="billingMode" not-null="true" type="string"/>
<property column="PRICE" length="6" name="price" not-null="true" type="integer"/>
<property column="USING_MODE" length="1" name="usingMode" not-null="true" type="string"/>
<property column="SERVICE_TYPE" length="100" name="serviceType" not-null="true" type="string"/>
<property column="IS_SUB" length="1" name="isSub" not-null="true" type="string"/>
<property column="SUB_HELP" length="140" name="subHelp" type="string"/>
<property column="UNSUB_HELP" length="140" name="unsubHelp" type="string"/>
<property column="SUB_URL" length="100" name="subUrl" type="string"/>
<property column="DESCRIPTION" length="500" name="description" type="string"/>


</class>
==============================
and when i execute the query
"from TService as service service.tsp.spName like :spName"

,i find nothing.but exist the data in my db(oracle),what is the matter?

thanks again!

yours' eckal.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2004 8:49 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
Hi,

have you tried this Query ? "from TService as service where service.tsp.spName=:spName" ?

regards


Top
 Profile  
 
 Post subject: I get it.
PostPosted: Thu Jul 15, 2004 4:47 am 
Newbie

Joined: Sun Jul 11, 2004 11:43 pm
Posts: 9
thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.