4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JHipster5.1を試してみた

Last updated at Posted at 2018-07-15

JHipsterというフレームワークの存在を知ったので試してみました。

環境構築

参考にしたサイトはこちらです。
https://www.jhipster.tech/installation/

今回はVagrant box installationを使ってみます。
https://github.com/jhipster/jhipster-devbox

vagrant init jhipster/jhipster-devbox

vagrant up --provider virtualbox

この結果色々なツールが良い感じにセットアップ済みのUbuntuが使えるようになります。
VirtualBoxからjhipster_default~~を実行すると以下のような素敵な画面が立ち上がります。
Screenshot_2018-07-15_03-35-41.png

簡単なアプリを書いてみる(チュートリアル)

まずはアプリを作ります。今回はフロントエンドはReactを選択しました。
https://www.jhipster.tech/creating-an-app/

その後にEntityを作ります。この際にインタラクティブに項目名やJPAのRelationshipの設定をします。
https://www.jhipster.tech/creating-an-entity/

この結果で良い感じにCRUDするアプリが出来ます。

Screenshot_2018-07-15_04-35-57.png

問題の修正

ただし、JHipster5.1固有の問題で、OneToManyのMany側をsaveする際にサーバーサイドでExceptionが発生しsaveに失敗します。
これは、Issueとしてすでに上がっている模様です。(fixされたかもしれません。ちょっと確認中。)
https://github.com/jhipster/generator-jhipster/issues/7967

修正箇所

  AvGroupの最後に以下のhiddenパラメータを追加する。
    <AvInput id="book-author-id" type="hidden" name="author.id" value={this.state.authorId} />
  </AvGroup>

感想

開発環境全部入りは楽チンで良いですね。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?