This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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(
at org.hibernate.hql.classic.ClauseParser.token(
at org.hibernate.hql.classic.PreprocessingParser.token(
at org.hibernate.hql.classic.ParserHelper.parse(
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(
at org.hibernate.impl.SessionFactoryImpl.getQuery(
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(
at org.hibernate.impl.SessionFactoryImpl.<init>(

My hibernate.cfg.xml file is given below

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Hibernate Migration
It's not a secret anymore!