-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hibernate 2 to 3 migration: Exception could not locate alias
PostPosted: Fri Apr 11, 2008 10:22 am 
Newbie

Joined: Fri Apr 11, 2008 10:14 am
Posts: 1
I am migrating hibernate 2 from hibernate 3.2.
I am using Query.creareQuery(
select distinct new com.heartbeat.profiler.commons.vo.DropdownIDValueBean(obj.id, obj.description, obj.deleteFlag)
from InteractionType as obj left outer join obj.interactions as associationObject
where ((obj.deleteFlag = 0) OR ((obj.deleteFlag = 2) AND (associationObject.id = 1196)))).setLockMode("obj", LOCKMODE.READ)

With hibernate 2 it was working fine
however for hibernate 3 it is giving me exception
java.lang.IllegalArgumentException: could not locate alias to apply lock mode : obj
at org.hibernate.loader.hql.QueryLoader.applyLocks(QueryLoader.java:297)
at org.hibernate.loader.Loader.preprocessSQL(Loader.java:201)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)


Any pointers will be useful.
Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.