element « HQL « JPA Q&A

1. hibernate HQL elements error    stackoverflow.com

My HibernateUserImpl mapping look like below

<set name="groups" table="OS_USER_GROUP" inverse="false" cascade="none" lazy="false">
    <key column="user_id"/>
    <many-to-many column="group_id" class="com.opensymphony.user.provider.hibernate3.ahxu.impl.HibernateGroupImpl"/>
I do HQL query like
select distinct hibuser from HibernateUserImpl ...

2. HQL to get elements that possess all items in a set    stackoverflow.com

Currently, I have an HQL query that returns all Members who possess ANY Award from a set of specified Awards:

from Member m left join m.awards as a where a.name in ("Trophy","Ribbon");
What ...

4. HQL How to use in elements()    forum.hibernate.org

5. HQL: is it possible to access elements of elements?    forum.hibernate.org

SELECT person FROM Person person WHERE EXISTS ( SELECT kitten FROM Kitten kitten WHERE kitten.name in ('Moses', 'Shrek') ...

6. basic HQL question about elements() function    forum.hibernate.org

7. HQL, "all elements" parameters    forum.hibernate.org

Object result = RequestContext.getHibernateSession().createQuery( "select 1 from CalendarEventPersonImpl cal where publicEvent = true and creator = all elements(:persons) and calendarEventType.id IN (:calendarEventTypeList) and startTime < current_timestamp() and endTime > current_timestamp()") .setParameterList("persons", persons) .setParameterList("calendarEventTypeList", new String[] {"EVENT_HOLIDAY", "EVENT_ABSENCE", "EVENT_VACATION"}) ...