I have used both org.hibernate.hql.classic.ClassicQueryTranslatorFactory and org.hibernate.hql.ast.ASTQueryTranslatorFactory both but, its not working The error is defined 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) 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)
Underneath the Add Reply button are a set of buttons to make some portions of posts look cleaner. Like the CODE button. This will put CODE tags in your post, where you can post code, or other formatted text that you want to keep the indentation. Like an XML file. Not using these and having XML look lik ehow it is posted is really tough to read, at least for me.
Where is your UserTargetedContent mapping xml. Please post that. I see that your query is using the old fashion WHERE clause theta-style join. If you have a foreign key in the UserTargetedContent to the HotLink, or the other way around, I would probably use that as a FROM clause JOIN.
Also, why do you have to define a hibernate.query.factory_class property at all?
"Also, why do you have to define a hibernate.query.factory_class property at all?"
And why are you using "sql-type" instead of just "type"
Also, I really think that in order to do that query you need to make it an sql-query instead of HQL, mostly because those two objects don't have references to each other, and so how does Hibernate know what type of Object to create when running that query. With the SQL query you can run it and it will return an Object[]