使用JHipster和JavaSpring的数据库模型和api优先(openapi)方法
我试图学习并使用Java和Spring中JHipster的API first方法。到目前为止,我已经在OpenAPI3.0规范中生成了描述我的API的yaml文件,然后我生成了控制器和委托等Java类来实现服务等。但我已经到了我想知道项目的数据库模型的地步(db是PostgreSQL) 何时或如何为API添加数据库架构? JHipster应该使用yaml文件为我的项目自动生成Hibernate实体(现在没有),还是应该在其他工具中手动创建数据库模型?或者我应该在创建API之前准备好数据库模型吗 有没有办法将OpenAPI转换为Hibernate实体并导入模式?在api first+Hibernate/数据库模式的上下文中,JHipster中的正确工作流是什么 我认为最好的方法是准备好API,其余的都自动完成 我的数据类型在api.yaml中描述如下:使用JHipster和JavaSpring的数据库模型和api优先(openapi)方法,java,spring,hibernate,jhipster,openapi,Java,Spring,Hibernate,Jhipster,Openapi,我试图学习并使用Java和Spring中JHipster的API first方法。到目前为止,我已经在OpenAPI3.0规范中生成了描述我的API的yaml文件,然后我生成了控制器和委托等Java类来实现服务等。但我已经到了我想知道项目的数据库模型的地步(db是PostgreSQL) 何时或如何为API添加数据库架构? JHipster应该使用yaml文件为我的项目自动生成Hibernate实体(现在没有),还是应该在其他工具中手动创建数据库模型?或者我应该在创建API之前准备好数据库模型吗
components:
schemas:
Advert:
description: Advert data type
required:
- id
- title
- description
- ownerId
- phoneNumber
- categoryId
- cityCode
- creationDate
type: object
properties:
id:
description: Id
type: integer
title:
description: Title of advert
type: string
description:
description: Description of advert
type: string
ownerId:
description: Id of owner user.
type: integer
phoneNumber:
description: Advert's phone contact number.
type: number
viewCount:
description: View count.
type: integer
categoryId:
description: Category of advert.
type: integer
images:
description: URLs of images.
type: array
items:
type: string
cityCode:
description: City code.
type: string
creationDate:
description: Creation date.
type: string
你好@user3157855。你是怎么解决的?我只是面临着同样的问题,我不想走一条无效的路线。谢谢还没有解决它:/