How to set up Hibernate HQL editor in Eclipse using custom NamingStrategy

I installed Hibernate Tools 3.2.4.GA in Eclipse Ganymede. The main driver for installing it was the ability to interactively query HQL queries.

I have configured all of our mapping files, hibernate.properties, etc., and it displays all of our entities and mappings and can read the list of tables from the database. It does not seem to use the custom naming strategy specified in the configuration, and therefore I cannot request anything. The query in Dynamic SQL Preview is correct, with the exception of table names.

The way I set up the naming strategy was to right-click on the sleep configuration and select "change configuration". On the Options tab, I’m looking at a naming strategy. Eclipse can find the naming strategy and automatically complete it for me, which indicates that it is in the classpath. Then I clicked OK and still have problems.

Am I missing something in the naming strategy configuration for the hibernation tools (now these will be jboss tools) or is it broken?

Optionally, is there another tool that I could use (inside or outside Eclipse) to issue HQL instructions for my database and be able to see the results?

UPDATE The problem was the implementation of NamingStrategy. It adds a line at the beginning of each table and changes the case of the camel to all lowercase letters with underscores. Unfortunately, in the implementation, the string is entered through spring, and is not set by default. This spring injection was not performed in hibernation tools, and since there was no default, the row was empty. It has been modified to have a default value (which matches our current spring configuration), and now it works.

+4
source share
3 answers

I have not used Hibernate Tools in Eclipse. But here is an alternative solution for issuing HQL instructions for your database.

There is a tool called the HQE Hibernate Query Editor. Hibernate Query Editor (HQE) is a simple application designed to simplify writing HQL / SQL queries for Hibernate. It has simple functions such as syntax highlighting and other editing materials.

Additional information about HQE can be found here https://hqe.dev.java.net/

+1
source

You can take a look at my plugin, which can easily create simple hqls. http://fast-code.sourceforge.net/

0
source

Set hibernate with myeclipse and you will get various options. This may help http://www.skill-guru.com/blog/tag/hibernate-and-eclipse-tutorial/

-1
source

All Articles