java:playframework:createmodel
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
java:playframework:createmodel [2018/07/24 15:57] – 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> | ||
- | # This is the main configuration file for the application. | + | db.default.driver=com.mysql.jdbc.Driver |
- | # https://www.playframework.com/ | + | db.default.url=" |
+ | db.default.user=< | ||
+ | db.default.password=< | ||
+ | </sxh> | ||
- | play.modules { | + | * ebean.defaultにmodelsを追加 |
- | enabled += " | + | |
- | } | + | |
- | play.db { | + | < |
- | config | + | ebean.default="models.*" |
- | | + | </ |
- | # Play uses HikariCP as the default connection pool. You can override | + | === build.sbt === |
- | # settings by changing the prototype: | + | |
- | prototype { | + | |
- | # Sets a fixed JDBC connection pool size of 50 | + | |
- | hikaricp.minimumIdle | + | |
- | hikaricp.maximumPoolSize | + | |
- | } | + | |
- | } | + | |
- | db { | + | * PlayEbeanの追加 |
- | default.driver = com.mysql.jdbc.Driver | + | |
- | default.url = " | + | |
- | default.username = [Username] | + | |
- | default.password = [Password] | + | |
- | } | + | |
- | ebean.default | + | < |
+ | lazy val myProject | ||
+ | </ | ||
+ | |||
+ | | ||
+ | |||
+ | < | ||
+ | libraryDependencies += jdbc | ||
+ | libraryDependencies ++= Seq( | ||
+ | " | ||
+ | ) | ||
</ | </ |
java/playframework/createmodel.1532415477.txt.gz · 最終更新: 2018/07/24 15:57 by taka