Hello,
i'm getting this exception by trying to fetch some objects.
I defined the class like this:
Code:
<hibernate-mapping>
<class name="Menu" table="M_MENU_DEF">
<id name="id"></id>
<property column="KEY" name="key"/>
<set name="items" inverse="true">
<key/>
<one-to-many class="MenuItem"/>
<loader query-ref="items"/>
</set>
</class>
<class name="MenuItem" table="M_MENU_ITEM_DEF">
<id name="id"></id>
<property column="KEY" name="key"/>
<property column="BEANNAME" name="beanName"/>
<property column="BEANMETHOD" name="beanMethod"/>
</class>
<sql-query name="items">
<load-collection alias="item" role="Menu.items"/>
<![CDATA[
SELECT {item.*}
FROM M_MENU_ITEM_DEF item
WHERE ID IN(
SELECT T2.M_MENU_ITEM_DEF_FK
FROM M_MENU_ITEM_ACCESS_RIGHT_CONF T2
WHERE T2.ROLE_FK IN (:roles) OR T2.ROLE_FK=0
)
]]>
</sql-query>
</hibernate-mapping>
The Dao-Method looks like this:
Code:
public Set<Menu> fetchMenu(Set<String> roleNames) {
LogUtil.methodEnteredLog(LOG, "roleNames=" + roleNames);
Set<Menu> menu = new HashSet<Menu>();
getHibernateTemplate().getSessionFactory()
.getCurrentSession()
.createQuery("from Menu")
.setParameterList("roles", roleNames);
LogUtil.methodReturningLog(LOG, menu);
return menu;
}
Does somebody know what I'm doing wrong? Please, help!
Thnx in advance