File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
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: 17260

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
subject: Hibernate Migration