Hi,
I am migrating my application from hibernate 2.0 to hibernate 3.0 .
I have changed my hibernate.cfg.xml XML DTD to hibernate 3.0
I have changed my hibernate.hbm.xml XML DTD to hibernate 3.0
I have changed my hibernate java classes from net.sf.hibernate into org.hibernate and when i
execute i am getting this error...
Here is my hibernate.hbm.xml file.. 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 in (:userPermissionCode) order by link.userPermissionCode, link.displayName]]></query>
</hibernate-mapping>
My hibernate.cfg.xml file is given below..
<?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"/>
<mapping resource="/com/wamu/dashboard/security/permission/UserTargetedContent.hbm.xml"/>
</session-factory>
</hibernate-configuration>
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)
Please help me.. Thanks in advance..
|