-->
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.  [ 2 posts ] 
Author Message
 Post subject: Need help with hql.ast.QuerySyntaxException
PostPosted: Tue Oct 31, 2006 8:19 pm 
Newbie

Joined: Sun Oct 15, 2006 11:20 pm
Posts: 13
I am getting a hql.ast.QuerySyntaxException with my HQL. I appreciate if anyone can help. I can't figure out what's wrong.

Here is my HQL syntax:
Code:


  List phones = getHibernateTemplate().find("from Product make=?", make);



Code:
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: = near line 1, column 49 [from com.test.model.Product make=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: = near line 1, column 49 [from com.test.model.Product make=?]
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: = near line 1, column 49 [from com.novarra.downloadserver.model.Phone make=?]
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
   at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
   at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
   at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:832)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
   at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:830)
   at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:826


Here is my mapping file:
Code:
<hibernate-mapping>

    <class name="com.test.Produce" table="PRODUCTS">
        <id name="id" column="PRODUCT_ID">
            <generator class="native"/>
        </id>
     <version name="version" column="version" type="java.lang.Integer"/>
     
        <property name="make"/>
        <property name="model"/>
       
    </class>

</hibernate-mapping>


I appreciate if anyone can help me with that.
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 9:40 pm 
Newbie

Joined: Sun Oct 15, 2006 11:20 pm
Posts: 13
I figure out what's wrong with my problem. Sorry for any confusion.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.