How to configure Hibernate Tools HQL editor in Eclipse with a custom NamingStrategy

1,147

I didn't use Hibernate Tools in Eclipse. But here is an alternative solution to issue HQL statements against your database.

there is tool called HQE Hibernate Query Editor. Hibernate Query Editor (HQE) is a simple application designed to make easy the work of writting HQL/SQL queries for Hibernate. It has simple features like syntax highlight and other editing stuff.

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

Share:
1,147
ben-ju
Author by

ben-ju

Updated on July 09, 2022

Comments

  • ben-ju
    ben-ju almost 2 years

    Here is the command I used to create containers :

    docker network create prestashop
    
    docker run -ti --name db --network prestashop -e MYSQL_ROOT_PASSWORD=1234 -p 3307:3306 -d mysql:latest
    
    docker run -ti --name prestashop --network prestashop -e DB_SERVER=db -p 8080:80 -d prestashop/prestashop
    

    With that I can access to the Prestashop installation however when I need to configure the database I get this error :

    Database Server is not found. Please verify the login, password and server fields (DbPDO)
    

    I'm using thoses fields :

    Database server address : (for this one I tried :)  db | 127.0.0.1:3037 | 127.0.0.1
    
    Database name : prestashop
    
    Database login : root
    
    Database password : 1234
    

    And I'm stuck to this step

    EDIT :

    Tried :

    • Insert another computer the same commands, everything works until I try to connect from the prestashop database configuration.

    • Removing the -ti options from the command line like @balexandre said.

    Update

    The issue come from the MySQL Version 8. I changed the mysql:latest to mysql:5.7 and everything is working but this is not the version I'm looking for. I still have no clue why MySQL 8 doesn't work

    • balexandre
      balexandre over 3 years
      can you access the database from a GUI? meaning you can connect to the database? - this is how I actually run my docker services, in case you want to have a look
    • ben-ju
      ben-ju over 3 years
      Yes i'm using : mysql --host=127.0.0.1 --port=3307 --user=root --password=1234 and evrything seems to work
    • balexandre
      balexandre over 3 years
      never worked with, but maybe investigating if PrestaShop can connect to any other port that is not the default one?
    • ben-ju
      ben-ju over 3 years
      yes it says that the default port is 3306 but you can specify by typing <address:port>
  • digitaljoel
    digitaljoel about 15 years
    good thought... wouldn't start out of the box for me in cmd.exe or cygwin even without me mucking it up with additional configuration.
  • digitaljoel
    digitaljoel over 14 years
    Your blog entry doesn't reference the hibernate tools plugin at all.
  • Erick Luz
    Erick Luz over 4 years
    the link is broken
  • ben-ju
    ben-ju over 3 years
    Yes, I tried this solution as mentionned in the doc, does this worked for you ? Because I still get the error
  • balexandre
    balexandre over 3 years
    you can see it works for me, it says "Connection to MySQL server succeeded"... the warning is that it will create a new database as the one mentioned in "Database name" does not exist yet....
  • balexandre
    balexandre over 3 years
    @ben-ju the only thing different is, I didn't use the interaction param, so I didn't run the docker commands with -ti, just removed that to run normally as I didn't need to jump inside the CLI
  • ben-ju
    ben-ju over 3 years
    sorry, I was in lunch break thanks for your response. I tried to recreate with the command and by removing the -ti, still have the same issue. I must have done something wrong if yours is working by the command I wrote
  • balexandre
    balexandre over 3 years
    I've executed step by step and worked... try to remove the images and start again. Stop both containers, remove containers and then remove the images...
  • ben-ju
    ben-ju over 3 years
    I completely uninstalled docker, images, containers, networks. I tried using mysql:latest and mysql:8.0 and for both I can't connect to the database. But when I try to connect to my database with the command line you wrote : mysql -uroot -padmin -h localhost --port 3307 I connect to my apache server and not the docker container. This one works docker exec -it db mysql -uroot -p
  • ben-ju
    ben-ju over 3 years
    Thanks a lot for your patience, I really appreciate that you took time for a junior. I found the solution. Prestashop is not familiar with the plugin caching_sha2_password so I had to change it to mysql_native_password on the root@% user
  • Jono
    Jono over 2 years
    Has anyone got a docker-compose.yml solution for this?
  • Jono
    Jono over 2 years