eclipse-来自表的JPA实体,未列出任何模式 [英] eclipse - JPA entities from tables, no schemas listed

查看:60
本文介绍了eclipse-来自表的JPA实体,未列出任何模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库(称为"socializer")驻留在MariaDB服务器中,并且我正在尝试从Eclipse中该数据库的表生成JPA实体,但是不能,因为

我在尝试连接到以前没有其他模式的另一个数据库时遇到了这个问题.

转到项目->属性-> JPA 并禁用/取消选中从连接中覆盖默认模式

如果所选数据库中不存在所选的架构,则在创建实体时将不会显示任何架构.对我来说,问题是,Eclipse以前试图从数据库中显示模式.

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).

解决方案

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

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

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.

这篇关于eclipse-来自表的JPA实体,未列出任何模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆