视图实体Jhipster [英] Entity for a view Jhipster

查看:51
本文介绍了视图实体Jhipster的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jhipster的新手,我想知道是否可以使用jhipster命令为类似于表格的视图创建实体?以及如何做到?

我使用了jhipster实体命令,但是我不确定这是正确的方法

解决方案

JHipster在Liquibase中不支持SQL视图,但是JDL允许您将实体标记为只读,这将阻止生成用于创建或更新实体的代码.

然后您可以手动调整生成的代码以按视图替换表,应将其限制为Liquibase迁移文件.

有关示例,请参见JDL官方文档: https://www.jhipster.tech/jdl/options

jhipster entity命令还会询问您是否应将新实体设为只读.

I am new in jhipster and I would like to know If I can create an entity for a view like the table with jhipster command ? And how to do it ?

I used jhipster entity command but I am not sure this is the right way to do it

解决方案

JHipster does not support SQL views in Liquibase but JDL lets you flag an entity as read-only which will prevent generating code for creating or updating an entity.

You can then manually adapt generated code to replace table by view, it should be limited to Liquibase migration file.

See official JDL doc for examples: https://www.jhipster.tech/jdl/options

jhipster entity command also asks you whether new entity should be read-only.

这篇关于视图实体Jhipster的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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