Hi Matthew,
Matthew Wu wrote:
In my DAO, I want to query all data from database.
In Appfuse1.9.x, I write:
"getHibernateTemplate().find("from DqMenu");
I do that also in Appfuse 2.0
Now, In appfuse2.0. When execute this code there will be a error. because
there is no hbm.xml in appfuse2.0
There's a hibernate.cfg.xml in your src/main/resources directory so I
don't think that's the cause of your error - I use the class name all
the time. Does your POJO (model class) have an @Entity tag? If so, then
you need to specify the entity name in your HQL string. So, for example
if your model has:
@Entity(name="dqmenu")
then in your finder would have to be:
getHibernateTemplate().find("from dqmenu"). If you have an @Entity
notiation without the (name=..) part, then just the classname (ie
without the package) should work - it does for me.
when i use "getHibernateTemplate().find("from
com.bt.agora.dqviewer.security.model.DqMenu");
there still will be a error: :no persistent classes found for query class:
from com.bt.agora.dqviewer.security.model.DqMenu
if i want to still use find("") method, what can i do? I mean: I don't
know how to create relationship between an object name in find("object
Name") and a model.
HTH,
Rob Hills
Waikiki, Western Australia
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]