Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse - JPA entities from tables, no schemas listed

I have a database (called "socializer") residing within MariaDB server and I'm trying to generate JPA entities from tables of that database in Eclipse, but cannot, because schema selection is grayed. Any ideas why?

My setup: Eclipse Neon, Eclipse Link 2.5.2, MariaDB 10.1.19-1, Arch Linux.

I know that the connection to my database has been established, because I can see it listed in Data Source Explorer, but its "Schemas" folder is displayed just empty, although it actually contains a few tables, created and perfectly observed within MySQL Workbench (the other listed databases appear to have empty "Schemas" as well).

JDBC connection properties:

Database: "socializer"
URL: "jdbc:mariadb://localhost:3306/socializer"
User name: root
Password: ""

JDBC driver (Generic JDBC Driver, mariadb-java-client-1.5.5.jar) properties:

Connection URL: "jdbc:mariadb://localhost:3306/socializer"
Database Name: "socializer"
Driver Class: "org.mariadb.jdbc.Driver"
User ID: "root"

And yes, user name and password are ok (ping will fail if either of them is changed).

like image 693
exalex Avatar asked Oct 17 '22 20:10

exalex


2 Answers

In Addition to the comments, I found another reason that might cause the problem, that no schema's are listed:

enter image description here

I run into this while trying to connect to another database with other schemas than before.

Go to Project -> Properties -> JPA and disable/uncheck Override default schema from connection

enter image description here

If there is a schema selected that doesn't exist in the selected database, no schemas will be shown when creating entities. For me the problem was, that Eclipse was trying to show a schema from the database before.

like image 157
Ruik Avatar answered Oct 21 '22 03:10

Ruik


In my case my database name was not case sensitive.

like image 34
ChillDochMal Avatar answered Oct 21 '22 04:10

ChillDochMal