java:playframework:createmodel
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
java:playframework:createmodel [2018/08/27 14:00] – [設定ファイルへの定義] taka | java:playframework:createmodel [2018/08/27 14:56] (現在) – [設定ファイルへの定義] taka | ||
---|---|---|---|
行 6: | 行 6: | ||
データベースを使用する場合は手動で用意する必要があります。\\ | データベースを使用する場合は手動で用意する必要があります。\\ | ||
その後、modelsパッケージ内に必要なモデルクラスを作成していきます。 | その後、modelsパッケージ内に必要なモデルクラスを作成していきます。 | ||
+ | |||
+ | ==== play-ebean ==== | ||
+ | |||
+ | まずは使用環境に合わせてplay-ebean(Ebean Plugin)のバージョンを選定します。 | ||
+ | |||
+ | {{: | ||
==== 設定ファイルへの定義 ==== | ==== 設定ファイルへの定義 ==== | ||
行 18: | 行 24: | ||
=== conf/ | === conf/ | ||
+ | |||
+ | * MySQLの設定追加 | ||
<sxh> | <sxh> | ||
- | # Configuration | + | db.default.driver=com.mysql.jdbc.Driver |
+ | db.default.url=" | ||
+ | db.default.user=< | ||
+ | db.default.password=< | ||
+ | </ | ||
- | # Ebean configuration | + | * ebean.defaultにmodelsを追加 |
- | # ~~~~~ | + | |
- | # You can declare as many Ebean servers as you want. | + | <sxh> |
- | # By convention, the default server is named `default` | + | |
ebean.default=" | ebean.default=" | ||
+ | </ | ||
+ | |||
+ | === build.sbt === | ||
+ | |||
+ | * PlayEbeanの追加 | ||
+ | |||
+ | <sxh> | ||
+ | lazy val myProject = (project in file(" | ||
+ | </ | ||
+ | |||
+ | * JDBCとMySQL Connectorの追加 | ||
+ | |||
+ | <sxh> | ||
+ | libraryDependencies += jdbc | ||
+ | libraryDependencies ++= Seq( | ||
+ | " | ||
+ | ) | ||
</ | </ |
java/playframework/createmodel.1535346058.txt.gz · 最終更新: 2018/08/27 14:00 by taka