• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate join query error "charScanner; panic:"

 
Manikandan MK
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mappings are as follows

FOR TABLE "LKUP_DETL"

<hibernate-mapping package="com.patni.rrts.beans.admin">
<class name="SBUSelection" table="LKUP_DETL">
<id name="sbuId" column="LKUP_ID"
type="java.lang.String" />
<property name="lkpCode" column="LKUP_CD"
type="java.lang.String" />
<property name="sbuName" column="LKUP_VALUE_DESC"
type="java.lang.String" />
<join table ="SBU_ACCT_LKUP">
<key column="LKUP_ID"/>
</join>
</class>
</hibernate-mapping>


FOR TABLE SBU_ACCT_LKUP

<hibernate-mapping package="com.patni.rrts.beans.admin">
<class name="AccountSelection" table="SBU_ACCT_LKUP">
<id name="accntId" column="LKUP_ID" />
<property name="sbuId" column="SBU_ID" />
</class>
</hibernate-mapping>



The query is

Query q = session.createQuery("SELECT lkp FROM LKUP_DETL lkp JOIN lkp.sbu_acct_lkup");
Iterator items = q.list().iterator();
System.out.println("Stage 1");
while(items.hasNext()){
System.out.println("Stage 2");
SBUSelection sbsel = (SBUSelection)items.next();
System.out.println("NAME of accounts" + sbsel.getSbuName));
}


On execution of this code it throws an error

charScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

Please advise ..Is it a problem with the mapping .How to form a mapping xml to perform a simple join operation on two tables.The docs on web is not clear

Thanks,
Mani.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ClassNotFoundException appears when a particular class cannot be found by the ClassLoader (so its nothing to do with the mapping). Check org.hibernate.hql.ast.HqlToken is in your classpath. You may have a conflict with more than one version of Hibernate kicking around, make sure you are only using Hibernate3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic