-->
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: Big Problem with many-to-one
PostPosted: Tue May 24, 2005 4:51 am 
Newbie

Joined: Tue May 24, 2005 3:44 am
Posts: 1
Hi,
I’ve got a big problem with query building. I would like to find an Apteka where Cegla is “in” a set. I receive a set of IdCegla from WebBrowser.
I can’t find any solution. I tried Query by Example and HQL. Thanks for any advices.

There are xml files.
Apteka::
<?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="pl.com.webtel.webplat.struct.hibernate.TApteka"
table="T_Apteka"

>
<id
name="IdApteka"
type="java.lang.Integer"
>
<column name="IdApteka" length="11" not-null="true" unique="true" sql-type="int" />
<generator class="native" />
</id>

<many-to-one
name="Tcegla"
class="pl.com.webtel.webplat.struct.hibernate.TCegla"
>
<column name="IdCegla" length="11" not-null="false" />
</many-to-one>

……

</class>
</hibernate-mapping>

Cegla::
<?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>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class
name="pl.com.webtel.webplat.struct.hibernate.TCegla"
table="T_Cegla"

>
<id
name="IdCegla"
type="java.lang.Integer"
>
<column name="IdCegla" length="11" not-null="true" unique="true" sql-type="int" />
<generator class="native" />
</id>
……
<set
name="SetOfTApteka"
>
<key>
<column name="IdCegla" length="11" not-null="false" />
</key>
<one-to-many
class="pl.com.webtel.webplat.struct.hibernate.TApteka"
/>
</set>
………
</class>
</hibernate-mapping>


Thanks
Mathew


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.