-->
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.  [ 5 posts ] 
Author Message
 Post subject: hibernate migration (Very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 4:33 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
I am migrating from hibernate 2 to 3.0 and when am executing am getting this error.plz help me

org.hibernate.QueryException: Incorrect query syntax [select link, userTargetedContent.displayName from com.wamu.dashboard.hotlinks.HotLink link, com.wamu.dashboard.security.permission.UserTargetedContent userTargetedContent where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode (:userPermissionCode) order by link.userPermissionCode, link.displayName]
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:192)
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)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at com.wamu.dashboard.util.hibernate.HibernateUtil.init(HibernateUtil.java:303)
at com.wamu.dashboard.util.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:75)
at com.wamu.dashboard.util.hibernate.HibernateCommandExecutor.getSession(HibernateCommandExecutor.java:76)
at com.wamu.dashboard.util.hibernate.HibernateCommand.this(HibernateCommand.java:26)
at com.wamu.dashboard.util.hibernate.HibernateCommand.<init>(HibernateCommand.java:31)
at com.wamu.dashboard.security.permission.GetUserTargetedContentCommand.<init>(GetUserTargetedContentCommand.java:30)
at com.wamu.dashboard.security.permission.web.GetUserTargetedContentServlet.myService(GetUserTargetedContentServlet.java:49)
at com.wamu.dashboard.util.web.BaseServlet.service(BaseServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:626)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:412)
at jsp_servlet._admin._hotlinks.__index._jspService(__index.java:276)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.util.NoSuchElementException
at java.util.LinkedList.getLast(LinkedList.java:118)
at org.hibernate.hql.classic.WhereParser.closeExpression(WhereParser.java:305)
at org.hibernate.hql.classic.WhereParser.token(WhereParser.java:247)
at org.hibernate.hql.classic.WhereParser.end(WhereParser.java:287)
at org.hibernate.hql.classic.ClauseParser.endChild(ClauseParser.java:99)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:53)
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)
... 32 more


My hibernate.cfg.xml is

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">weblogic.jdbc.jts.WAMUPool</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<!-- <property name="show_sql">true</property> -->
<mapping resource="/com/wamu/dashboard/hotlinks/HotLink.hbm.xml"/>
<mapping resource="/com/wamu/dashboard/security/permission/Permission.hbm.xml"/>
</session-factory>
</hibernate-configuration>


My hbm.xml (Name : Hotlink.hbm.xml )

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-cascade="none">
<class name="com.wamu.dashboard.hotlinks.HotLink" table="HOT_LINK">
<id name="hotLinkId" type="integer" unsaved-value="null" >
<column name="HOT_LINK_ID" sql-type="integer" not-null="true"/>
<generator class="sequence">
<param name="sequence">HOT_LINK_SEQ</param>
</generator>
</id>
<property name="displayName">
<column name="DISPLAY_NAME" sql-type="varchar(60)" />
</property>
<property name="userPermissionCode">
<column name="USER_PERMISSION_CODE" sql-type="varchar(20)" />
</property>
<property name="link">
<column name="LINK" sql-type="varchar(60)" not-null="true"/>
</property>
</class>
<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>


Plz help me soon.


Top
 Profile  
 
 Post subject: Re: hibernate migration (Very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 4:47 am 
Newbie

Joined: Tue Oct 03, 2006 2:57 am
Posts: 4
thangadangi wrote:
where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode (:userPermissionCode) order by link.userPermissionCode, link.displayName]


are you missing an '=' or similar operator between link.userPermissionCode and (:userPermissionCode)?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 4:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are:

- http://www.hibernate.org/ForumMailingli ... AskForHelp
- You did not submit enough information
- Nobody knows the answer or has the free time to answer

What you can do now:

- Do the things listed in After Posting
- Add missing and/or more information
- Consider commercial support for guaranteed expert response times

This is a high-traffic forum run by volunteers with hundreds of postings made every day. The community works because people try to help others in their free time. Nobody is paid for this service or has to pay.

You should not expect a timely response and you should not rely on a public community forum for critical cases.

All community members should respect the rules of this forum and treat others like they would prefer to be treated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: hibernate migration (Very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 6:47 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
jcsfca wrote:
thangadangi wrote:
where link.userPermissionCode = userTargetedContent.userPermissionCode and link.userPermissionCode (:userPermissionCode) order by link.userPermissionCode, link.displayName]


are you missing an '=' or similar operator between link.userPermissionCode and (:userPermissionCode)?



No i haven't missed anything since it was working fine when it was in hibernate 2.0. After migration it was not working. Plz help me.........


what may be the possible cause for thiss...?

Thanks in advance..


Top
 Profile  
 
 Post subject: Re: hibernate migration (Very urgent!!!!!!!!!!!)
PostPosted: Wed Jan 10, 2007 6:52 am 
Newbie

Joined: Wed Jan 10, 2007 1:12 am
Posts: 9
Np... Its my CDATA and i havent missed anything but still the problem exixts...

<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>

plz help me...


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

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.