Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

How to resolve org.hibernate.QueryException for DELETE hql Query???

Posted by Pankil Patel on July 1, 2011

How to resolve org.hibernate.QueryException for DELETE hql Query???

If your hibernate-conf.xml file has <prop key=“hibernate.query.factory_class”>org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>

Then it will give org.hibernate.QueryException: query must begin with SELECT or FROM: DELETE [DELETE

To overcome this issue, remove the entry of “hibernate.query.factory_class” from your hibernate-conf.xml file or change it to org.hibernate.hql.ast.ASTQueryTranslatorFactory and enjoy the DELETE hql query.

Like:

hibernate.query.factory_class

hibernate.query.factory_class

Advertisements

2 Responses to “How to resolve org.hibernate.QueryException for DELETE hql Query???”

  1. Deepak said

    Thanks pakil..it also help to run my update query successfully as well..:-)

  2. Giri Talari said

    Thank u pankil.. it solves my problem.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: