Note that the import part did not work at all when creating a Model in "Play Framework 2 Thorough Introduction"
c:¥hoge>activator new [The name of the created project] play-java
c:¥hoge>cd [Created project]
plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.8")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.6")
#add to
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
#addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.2")
c:¥hoge¥hoge>activator eclipse
c:¥hoge¥hoge>activator run
It was all right so far, but I got hooked when creating the model.
Java file in question
Message.java
package models;
import java.util.Date;
import javax.persistence.*;
import com.avaje.ebean.Model;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
public class Message extends Model {
@Id
public Long id;
public String name;
public String mail;
public String message;
public Date pastDate;
}
Added to plugins.sbt
plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.8")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.6")
#add to
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
#Uncomment
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.2")
build.sbt
lazy val root = (project in file(".")).enablePlugins(PlayJava)
.enablePlugins(PlayEbean) //Postscript
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs,
javaJpa, //Postscript
"org.postgresql" % "postgresql" % "9.4.1212.jre7", //Postscript
"org.projectlombok" % "lombok" % "1.16.10" //Postscript
)
c:¥hoge¥hoge>activator update
c:¥hoge¥hoge>activator "eclipse with-source=true"
c:¥hoge¥hoge>activator compile
Solved for the time being.
Recommended Posts