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: need help with a query
PostPosted: Thu Nov 11, 2004 12:47 pm 
Newbie

Joined: Sun Nov 07, 2004 6:58 am
Posts: 8
Location: HH Germany
Hi
Hibernate version: 2.1.6

Mapping documents:[/b
<set name="menuLinksInternal" inverse="true">
<key column="menulink_id"/>
<one-to-many class="MenuLink"/>
</set>
<many-to-one name="menulink" column="menulink_id" class="MenuLink"/>


[b]Code between sessionFactory.openSession() and session.close():


public class MenuLink extends Link {

private Set menuLinks;

private MenuLink menulink;
...



now i need a query that gives me a List of MenuLinks that are:

(
don't have a menulink (so menulink = null)
or
which ar inside the Set of menuLinks from the given MenuLink

)
but not the given MenuLink self
and
not the menulink (given.getMenulink) from the given menulink

my query looks something like this


find("from MenuLink menulink where (menulink.menulink is null or
menulink.menulink=?) or menulink!=? and menulink!
=menulink.menulink.menulink", new
String[]{String.valueOf(id),String.valueOf(id)});


but this don't do what I will, have anyone any idea how to make this correct for me ?

Thanks.

mfg Gideon


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.