-->
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: Schema name appears twice in auto-generated HQL!! HELP
PostPosted: Wed Feb 16, 2011 2:27 pm 
Newbie

Joined: Wed Feb 16, 2011 1:56 pm
Posts: 7
Hi,

I'm using Hibernate for my SpringMVC web application with MySQL. I've used Hibernate Tools to auto-generate the Mapping POJO classes from my database.

Everything works fine except for one thing. Whenever there's any HQL executed that is supposed to fetch data from link tables via joins, the HQL is ill-formed.
E.g. I'm using LAZY fetching to get some related data. So the HQL that is auto-generated repeats the Schema name twice...e.g.
Code:
SELECT citynames2_.CityID AS CityID5_, citynames2_.CityName AS CityName5_
  FROM mad.mad.state_names statenames0_ INNER JOIN mad.state_city citynamese1_ on statenames0_.StateID=citynamese1_.StateID inner join mad.city_names citynames2_ on citynamese1_.CityID=citynames2_.CityID where stateName=?


Please note the repeating schema above. (My schema name is mad, which is also the default schema)

And hence i get the exception:
Code:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.state_city citynamese1_ on statenames0_.StateID=citynamese1_.StateID inner join' at line 1


Please guide me. How to solve this problem.


Top
 Profile  
 
 Post subject: Re: Schema name appears twice in auto-generated HQL!! HELP
PostPosted: Wed Feb 16, 2011 5:00 pm 
Newbie

Joined: Wed Feb 16, 2011 1:56 pm
Posts: 7
I solved the problem by removing the catalog='mad' from my persistence classes.

Now I' facing another issue:
Code:
java.sql.SQLException: Positioned Update not supported.


I've resolved the CycleDetectionStrategy by making it LENIENT.

And I face this problem. Please help.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.