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
|