简体   繁体   English

如何查看JHipster实体数据库

[英]How to view JHipster Entity Database

I'm setting up a Web App with JHipster. 我正在用JHipster建立一个Web应用程序。 I used JDL Entities to create my Domain Elements, while setting up JHipster i chose a MYSQL Database. 我使用JDL实体来创建我的域元素,而在设置JHipster时我选择了一个MYSQL数据库。 Additionally i have an Android App and i want it to use the same Database as the Web App. 另外我有一个Android应用程序,我希望它使用与Web应用程序相同的数据库。 How can i access the JHipster generated Database and do CRUD operations from another Application? 如何访问JHipster生成的数据库并从另一个应用程序执行CRUD操作?

I found some Jhipster generator module https://www.npmjs.com/package/generator-jhipster-administration-database 我找到了一些Jhipster发电机模块https://www.npmjs.com/package/generator-jhipster-administration-database

But the Database that i can view with this module has no tables when running on my App that already has Entities. 但是,在我已经拥有实体的应用程序上运行时,我可以使用此模块查看的数据库没有表格。

I don't really understand what you wanna do. 我真的不明白你想做什么。 But usually we have 2 solution for that 但通常我们有2个解决方案

  1. Use seperate way to access database from android app. 使用单独的方式从Android应用程序访问数据库。 In that case, you have to build connect to your database by yourself, using ORM or event pure SQL query is up to you. 在这种情况下,您必须自己构建与数据库的连接,使用ORM或事件纯SQL查询由您决定。 So the answer is you have to write it by yourself. 所以答案是你必须自己写。 How to write is available in google. 如何写在谷歌可用。

  2. Make android app using REST content provide by your web service. 使用您的Web服务提供的REST内容制作Android应用程序。 That is typical way i see in medium and big project. 这是我在大中型项目中看到的典型方式。 You can build a common back-end web service then using them for both web and android app through HTTP Request. 您可以构建一个通用的后端Web服务,然后通过HTTP请求将它们用于Web和Android应用程序。

你可以在你的jhipster应用程序中创建其他API并在你的Android应用程序中使用它们

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM