Forums Register Login

How to write a HQL in intellij in java based hibernate configuration ?

+Pie Number of slices to send: Send
In my spring mvc project I have configure hibernate using annotation based.


Now when I am trying to write HQL intellij can not find the entity class. It says : "can not resolve symbol 'User'". I have googled it, and I found that hibernate.cfg.xml file should be mapped by the intellij.

Now the problem is I don't have this hibernate config file. I have configure hibernate using java based.

So the question is , How to write a HQL in intellij in java based hibernate configuration ?

Thank you
+Pie Number of slices to send: Send
Can you show/share your query? Because that error is (normally) shown when you use a class using its simple name without an import statement. But if you are writing a HQL query, the query itself is a String. So that would be weird to get such an error on a String.
+Pie Number of slices to send: Send
 

Roel De Nijs wrote:Can you show/share your query?


This is basic delete query.



In this name variable can not resolve.
+Pie Number of slices to send: Send
 

Muztaba Hasanat wrote:In this name variable can not resolve.


I assume that's an error you get when trying to run your application, not when writing the code.

And what about using this query
+Pie Number of slices to send: Send
 

Roel De Nijs wrote:

Muztaba Hasanat wrote:In this name variable can not resolve.


I assume that's an error you get when trying to run your application, not when writing the code.

And what about using this query


Nope. I am getting this error when I am writing code. It is saying

Here is my screen shot :

+Pie Number of slices to send: Send
You are correct! (I am a very recent IntelliJ user with only 2 months experience, so I didn't know that )

It seems you can use Annotation Config when you are using the Spring Facet, but this option is not available if you configure the Hibernate and JPA Facet. I have no idea how to solve it. Maybe contact IntelliJ IDEA support and submit a request?

PS. I have added this topic to the IDEs forum as well. Maybe someone knows how it can be solved.
+Pie Number of slices to send: Send
 

Roel De Nijs wrote:You are correct! (I am a very recent IntelliJ user with only 2 months experience, so I didn't know that )

It seems you can use Annotation Config when you are using the Spring Facet, but this option is not available if you configure the Hibernate and JPA Facet. I have no idea how to solve it. Maybe contact IntelliJ IDEA support and submit a request?

PS. I have added this topic to the IDEs forum as well. Maybe someone knows how it can be solved.


thank you.

could you give me your intellij forum post link ? Therefore I can also keep track the update.
+Pie Number of slices to send: Send
 

Muztaba Hasanat wrote:could you give me your intellij forum post link ? Therefore I can also keep track the update.


I suggested you should submit a request, so I didn't submit one myself
+Pie Number of slices to send: Send
 

Roel De Nijs wrote:

Muztaba Hasanat wrote:could you give me your intellij forum post link ? Therefore I can also keep track the update.


I suggested you should submit a request, so I didn't submit one myself

ok
(1 cow) 1
+Pie Number of slices to send: Send
 

Muztaba Hasanat wrote:

Roel De Nijs wrote:

Muztaba Hasanat wrote:could you give me your intellij forum post link ? Therefore I can also keep track the update.


I suggested you should submit a request, so I didn't submit one myself

ok


It works. I have posted in reddit. They said it is only IDE that gives this error.

Here is my reddit post link.
https://www.reddit.com/r/javahelp/comments/48lphm/how_to_write_a_hql_in_intellij_in_java_based/
1
+Pie Number of slices to send: Send
 

Muztaba Hasanat wrote:It works. I have posted in reddit. They said it is only IDE that gives this error.


Awesome! Have a cow for coming back and sharing the solution.
+Pie Number of slices to send: Send
 

Roel De Nijs wrote:

Muztaba Hasanat wrote:It works. I have posted in reddit. They said it is only IDE that gives this error.


Awesome! Have a cow for coming back and sharing the solution.


Thanks
What a stench! Central nervous system shutting down. Save yourself tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5476 times.
Similar Threads
MySQL driver not getting registered
Spring + Hibernate
Glassfish Connection Pool -- ClassCastException in Application
Username existence check using AJAX and Java J2EE
Spring DAO + Hibernate; is this right?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:03:54.