Oh sorry, just noticed your Class name is Category in your first post.
Do you have another class called Categories? I assume not.
This query should work:
public List getMaleCategories() {
return getHibernateTemplate().find("from Category cat where
cat.male_only=?", Boolean.TRUE);
}
On 5/
Does this work for you?
public List getMaleCategories() {
return getHibernateTemplate().find("from Categories cat
where cat.male_only=?", Boolean.TRUE);
}
On 5/3/07, sionsmith <[EMAIL PROTECTED]> wrote:
Funny enough it was already present in the hibernate.cfg.xml file as this
statement
Funny enough it was already present in the hibernate.cfg.xml file as this
statement works & returns the correct result set back to me:
public List getCategories(){
return getHibernateTemplate().find("from Category cat order by
upper(cat.name)");
}
That statement works fine - its just
Looks like you need to add your category class/hbm.xml to the session
factory configuration. Which version of AppFuse are you using? If 2.0-m*,
then you should add the classname to hibernate.cfg.xml.
Mike
On 5/2/07, sionsmith <[EMAIL PROTECTED]> wrote:
I've tried that - neither worked - mayb
I've tried that - neither worked - mayb i have something in my Category.class
wrong? this is the error i got:
=== EXCEPTION ==
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethod
I think the problem is less your query, more the method you are using on
HibernateTemplate. This should work for you:
public List getMaleCategories() {
return getHibernateTemplate().find("from Categories
where male_only=?", Boolean.TRUE);
}
The named query form of the find method is used w