jQuery in Action, 3rd edition
The moose likes Object Relational Mapping and the fly likes Hibernate Migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Migration" Watch "Hibernate Migration" New topic

Hibernate Migration

renga ram

Joined: Jan 05, 2007
Posts: 10

I am migrating my applications from hibernate 2.0 to 3.0. In my hbm.xml file name Hotlink.hbm.xml i have used the [CDATA] query which is creating the problem. What change i have to make in this Hotlink.hbm.xml file inorder to get this working done.please help me.Thanks in advance.
Here is my Hotlink.hbm.xml

I want to know what is the relavant query in hibernate3.0 for the below mentioned query which is written in hibernate 2.0
note: Its working fine in hibernate 2.0

<query name="getHotLinksByPermissionCode"><![CDATA[select link, userTargetedContent.displayName from HotLink link, UserTargetedContent userTargetedContent where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode as (:userPermissionCode) order by link.userPermissionCode, link.displayName]]></query></hibernate-mapping>

The error is listed below.

<Jan 8, 2007 10:14:47 PM PST> <Error> <T3Services> <000000> <org.hibernate.impl.SessionFactoryImpl: Error in named query: getHotLinksByPermissionCode

org.hibernate.QueryException: in expected: userTargetedContent [select link, userTargetedContent.displayName from com.wamu.dashboard.hotlinks.HotLink link, UserTargetedContent userTargetedContent where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode in (:userPermissionCode) order by link.userPermissionCode, link.displayName]
at org.hibernate.hql.classic.FromParser.token(FromParser.java:106)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86)
at org.hibernate.hql.classic.PreprocessingParser.token(PreprocessingParser.java:108)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:29)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:176)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:152)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:425)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:386)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:289)

My hibernate.cfg.xml file is given below

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Is this different than your other thread? Please do not duplicate post.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link: http://aspose.com/file-tools
subject: Hibernate Migration
It's not a secret anymore!