java 从 JPA 实体自动生成 Spring Data Repositories

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41257851/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 05:46:53  来源:igfitidea点击:

Generate automatically Spring Data Repositories from JPA entities

javaspring-bootspring-dataspring-data-jpaspring-repositories

提问by CPA

I have a lot of JPA entities automatically created from a relational database schema.

我有很多从关系数据库模式自动创建的 JPA 实体。

Is there any way to generate also there corresponding Spring Data Repositories (Repository interfaces)?

有没有办法生成相应的 Spring Data Repositories(Repository 接口)?

采纳答案by Ihor Dobrovolskyi

You can use Spring Roo to create models and repositories by one command. http://docs.spring.io/spring-roo/reference/html/intro.html

您可以使用 Spring Roo 通过一个命令创建模型和存储库。 http://docs.spring.io/spring-roo/reference/html/intro.html

回答by Marco Sulla

Wel, it's not for JPA, but I created a tool, EWA, for creating Repositories, Servicesand Modelsfor Spring Boot+ sql2o, a simple db driver, the fastest after pure JDBC.

好吧,它不是为JPA,但我创建了一个工具,EWA,用于创建RepositoriesServicesModelsSpring Boot+ sql2o,一个简单的数据库驱动程序,在 pure 之后最快JDBC