-
1. Re: HQL query error shows up correctly and then disappears :
maxandersen Oct 14, 2007 6:14 AM (in response to alamandrax)You need to expand the hibernate console configuration's session factory to enable query validation to run.
-
2. Re: HQL query error shows up correctly and then disappears :
alamandrax Oct 14, 2007 6:53 AM (in response to alamandrax)Adding hibernate3 support to the project helped. Thanks for the tip!
-
3. Re: HQL query error shows up correctly and then disappears :
andersaa May 28, 2010 4:24 AM (in response to alamandrax)I am using Eclipse with Hibernate Tools installed from http://download.jboss.org/jbosstools/updates/stable/ (i.e. not JBoss Tools). Is this feature also available here?
I have created a Hibernate configuration, opened up the Session Factory (which lists all my entities), and enabled Hibernate support for the project. But I cannot see any traces of HQL validation occuring, no warnings in the problem view and no visual clues when editing queries. I am using @NamedQueries.
Is there anything else I need to configure?
Regards,
Anders
-
4. Re: HQL query error shows up correctly and then disappears :
maxandersen May 28, 2010 6:41 AM (in response to andersaa)if you are using the jboss tools update site you are using jboss tools
I'm not sure which feature you are asking about but the features in JBoss Developer Studio are the same as what is available from jboss tools updatesite when it comes to hibernate tools.
So as suggested above, enable hibernate 3 on the project by right clicking on the project, go to properties and enable the Hibernate support on the hibernate preference pane.
-
5. Re: HQL query error shows up correctly and then disappears :
andersaa May 28, 2010 6:49 AM (in response to maxandersen)Ah ofcourse I meant JBoss Developer Studio.
I have enabled Hibernate 3 support for the project, but it didn't seem to have any effect.
One issue though, in the hibernate configuration view ("Edit launch configuration properties") there is an error: "Project 'admin' must be a JPA project". The project is a JPA project and it manages to find the percsistence unists. And the config also seems to work, I find all entities and database tables under "Session Factory" and "Database". So I suspect this error is just a false positive.
-
6. Re: HQL query error shows up correctly and then disappears :
maxandersen May 28, 2010 6:54 AM (in response to andersaa)does your admin project point to the console configuration you are using ?
and I would like to see a screenshot of that error if you got it..
-
7. Re: HQL query error shows up correctly and then disappears :
andersaa May 28, 2010 7:06 AM (in response to maxandersen)I have set the console config as "Default Hibernate Console configuration", if that is what you mean.
Screenshot of the error is attached, thanks a bunch for helping!
-Anders
-
screenshot.png 145.6 KB
-
-
8. Re: HQL query error shows up correctly and then disappears :
vyemialyanchyk May 28, 2010 7:41 AM (in response to andersaa)Anders, which is your version of Eclipse?
-
9. Re: HQL query error shows up correctly and then disappears :
andersaa May 28, 2010 7:47 AM (in response to vyemialyanchyk)Using Eclipse Ganymede Java EE, 3.5.2 if I interpret the installation details correctly.
Hibernate Tools is version 3.3.0.v201003050540R-H56-GA.
-Anders
-
10. Re: HQL query error shows up correctly and then disappears :
maxandersen May 28, 2010 8:27 AM (in response to andersaa)So I *hope* that the error is there purely because you've chosen the "JPA Connection Profile" and what is meant by that is that your project should have Eclipse JPA support enabled.
Does it have that ?
But since you can actually use the configuration I'm a bit surprised things doesn't just work
Have you watched this: http://docs.jboss.org/tools/movies/demos/java_hql_editing_and_validation/java_hql_editing_and_validation.htm ?
The trigger for it is that the Session Factory needs to be expanded and that the project is set to point to this same console configuration
-
11. Re: HQL query error shows up correctly and then disappears :
andersaa May 28, 2010 9:12 AM (in response to maxandersen)Allright, I think that did the trick!
I installed the Dali JPA Tools plugin, added the "Java Persistence 1.0" facet (does that actually mean JPA 1.0? or is it the version of the plugin?), and after some configuration it now seems to work! Queries with errors are reported in Eclipse as errors, and code completion works in the queries. Yay
However, I get this error on all my entities:
Entity "Access" has no Id or EmbeddedId
The Access class extends a @MappedSuperclass, which in turn extends another @MappedSuperclass which has the Id field defined. Could it be that Dali doesn't support JPA2?
Anyway, thanks for helping, this is cool stuff indeed.
Regards,
Anders
-
12. Re: HQL query error shows up correctly and then disappears :
maxandersen May 28, 2010 1:33 PM (in response to andersaa)Good that it worked, but I would really like to know why it did not work for you without Dali installed (it should).
Have you tried selecting Hibernate Connections instead of JPA connection ? This would make it use the "native" connection info instead of what the JPA project will do.
Could you open a jira outlining what you did if that doesn't help ?