Hi,

I haven't used the tutorials for a while and I'm having a strange problem
where I get a hibernate exception about my Person class not being mapped:

Caused by: org.hibernate.hql.ast.QuerySyntaxException: Person is not mapped
[from Person p where p.lastName=?]


I found a post by Matt that looks similar but is from 2007 here:
http://appfuse.547863.n4.nabble.com/Person-is-not-mapped-from-Person-where-lastName-td578225.html#a578225

In this post, Matt resolves this problem by using the FQCN for Person in the
HQL in the finder like so:

public List<Person> findByLastName(String lastName) {
    return getHibernateTemplate().find("from
com.foo.dcs.project.model.Person p where p.lastName=?", lastName);
}

Using the FQCN works for me too but seems kind of nasty, is this required
now, we have to use fully qualified class names in the HQL statements?  Or
is there some minor tweak to the tutorial approach that allows you to simply
use the more usual "from Person p where p.lastName =?" in your HQL queries? 
The last time I used appfuse was last December, and I didn't have to do this
(I don't *think*), I don't have that code with me right now but I don't
remember having to do this.  Can anybody shed some light on this?  Thanks...

--jack

-- 
View this message in context: 
http://appfuse.547863.n4.nabble.com/Person-is-not-mapped-from-Person-p-where-p-lastName-tp2315088p2315088.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to