AppFuse 1.x uses XDoclet to generate hibernate mapping files
(*.hbm.xml). AppFuse 2.0 uses annotations (metadata in code). There's
nothing stopping you from using Hibernate mapping files in 2.0 - you
just need to specify them in hibernate.cfg.xml.
Matt
On 10/30/07, Matthew Wu <[EMAIL PROTECTED]> wrote:
>
> Thanks a lot, Rob
>
> Then, Should I modify all the annotation in POJO? (because annotation in
> appfuse2 is not the same as in appfuse1.9.x). Does it mean that annotation
> in appfuse2 is not compatible with in appfuse1.9.x?
>
> Matthew Wu
> Dalian China
>
>
>
> Rob Hills wrote:
> >
> > 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]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/how-to-resolve-this-serious-problem-about-appfuse2-hibernate-tf4716958s2369.html#a13502177
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]