Permalink
Browse files

Fix issue #8 in sample/yabe/models/Prost about find

  • Loading branch information...
1 parent eb2a7a4 commit ab70910ec1fe6d8b1c1f62d63a6b41771a521d79 @leodagdag committed Jun 25, 2012
View
@@ -35,7 +35,7 @@ object Play2MorphiaPluginBuild extends Build {
"com.google.code.morphia" % "morphia-validation" % "0.99",
"cglib" % "cglib-nodep" % "[2.1_3,)",
"com.thoughtworks.proxytoys" % "proxytoys" % "1.0",
- "play" %% "play" % "2.0" % "provided" notTransitive(),
+ "play" %% "play" % "2.0.1" % "provided" notTransitive(),
("org.springframework" % "spring-core" % "3.0.7.RELEASE" notTransitive())
.exclude("org.springframework", "spring-asm")
.exclude("commons-logging", "commons-logging"),
@@ -50,7 +50,7 @@ object Play2MorphiaPluginBuild extends Build {
val buildOrganization = "leodagdag"
val buildVersion = "0.0.6"
val buildScalaVersion = "2.9.1"
- val buildSbtVersion = "0.11.2"
+ val buildSbtVersion = "0.11.3"
val buildSettings = Defaults.defaultSettings ++ Seq (
organization := buildOrganization,
version := buildVersion,
View
@@ -1,69 +0,0 @@
-import sbt._
-import Keys._
-import com.typesafe.sbteclipse.plugin.EclipsePlugin._
-
-object Play2MorphiaPluginBuild extends Build {
-
- import Resolvers._
- import Dependencies._
- import BuildSettings._
-
- lazy val Play2MorphiaPlugin = Project(
- "play2-morphia-plugin",
- file("."),
- settings = buildSettings ++ Seq(
- libraryDependencies := runtime,
- publishMavenStyle := true,
- publishTo := Some(dropboxRepository),
- scalacOptions ++= Seq("-Xlint","-deprecation", "-unchecked","-encoding", "utf8"),
- javacOptions ++= Seq("-encoding", "utf8", "-g"),
- resolvers ++= Seq(DefaultMavenRepository, Resolvers.typesafeRepository, Resolvers.morphiaRepository)
- )
- ).settings(com.typesafe.sbtscalariform.ScalariformPlugin.defaultScalariformSettings: _*)
-
- object Resolvers {
- val githubRepository = Resolver.file("GitHub Repository", Path.userHome / "dev" / "leodagdag.github.com" / "repository" asFile)(Resolver.mavenStylePatterns)
- val dropboxRepository = Resolver.file("Dropbox Repository", Path.userHome / "Dropbox" / "Public" / "repository" asFile)(Resolver.mavenStylePatterns)
- val typesafeRepository = "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
- val morphiaRepository = "Morphia Repository" at "http://morphia.googlecode.com/svn/mavenrepo/"
- }
-
- object Dependencies {
- val runtime = Seq(
- "com.google.code.morphia" % "morphia" % "1.00-SNAPSHOT",
- "com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
- "com.google.code.morphia" % "morphia-validation" % "0.99",
- "cglib" % "cglib-nodep" % "[2.1_3,)",
- "com.thoughtworks.proxytoys" % "proxytoys" % "1.0",
- "play" %% "play" % "2.0" % "provided" notTransitive(),
- ("org.springframework" % "spring-core" % "3.0.7.RELEASE" notTransitive())
- .exclude("org.springframework", "spring-asm")
- .exclude("commons-logging", "commons-logging"),
- ("org.springframework" % "spring-beans" % "3.0.7.RELEASE" notTransitive())
- .exclude("org.springframework", "spring-core"),
- "commons-lang" % "commons-lang" % "2.6",
- "org.javassist" % "javassist" % "3.16.1-GA"
- )
- }
-
- object BuildSettings {
- val buildOrganization = "leodagdag"
-<<<<<<< HEAD
- val buildVersion = "0.0.5"
-=======
- val buildVersion = "0.0.5.12"
->>>>>>> origin/HEAD
- val buildScalaVersion = "2.9.1"
- val buildSbtVersion = "0.11.2"
- val buildSettings = Defaults.defaultSettings ++ Seq (
- organization := buildOrganization,
- version := buildVersion,
- scalaVersion := buildScalaVersion
- )
- }
-
- object EclipsePlugin {
- EclipseKeys.executionEnvironment := Some(EclipseExecutionEnvironment.JavaSE16)
- EclipseKeys.withSource := true
- }
-}
View
@@ -13,10 +13,10 @@ addSbtPlugin("com.typesafe.sbtscalariform" % "sbtscalariform" % "0.3.1")
resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
// Generate eclipse project
-addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0")
+addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")
// Use for intellij
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
// Use for intellij
-addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")
@@ -16,7 +16,9 @@
public Blob picture;
- public static Model.Finder<ObjectId, Post> find = new Model.Finder<ObjectId, Post>(ObjectId.class, Post.class);
-
+ public static Model.Finder<ObjectId, Post> find(){
+ return new Model.Finder<ObjectId, Post>(ObjectId.class, Post.class);
+ }
+
}
@@ -9,7 +9,7 @@ object ApplicationBuild extends Build {
val appDependencies = Seq(
// Add your project dependencies here,
- "leodagdag" % "play2-morphia-plugin_2.9.1" % "0.0.5"
+ "leodagdag" % "play2-morphia-plugin_2.9.1" % "0.0.6"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA)
@@ -1,30 +0,0 @@
-import sbt._
-import Keys._
-import PlayProject._
-
-object ApplicationBuild extends Build {
-
- val appName = "yabe"
- val appVersion = "1.0-SNAPSHOT"
-
- val appDependencies = Seq(
- // Add your project dependencies here,
-<<<<<<< HEAD
- "leodagdag" % "play2-morphia-plugin_2.9.1" % "0.0.5"
-=======
- "leodagdag" % "play2-morphia-plugin_2.9.1" % "0.0.5.12"
->>>>>>> origin/HEAD
- )
-
- val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA)
- .settings(
- resolvers ++= Seq(DefaultMavenRepository, Resolvers.githubRepository, Resolvers.morphiaRepository)
- )
-
- object Resolvers {
- val githubRepository = "LeoDagDag repository" at "http://leodagdag.github.com/repository/"
- val dropboxRepository = "Dropbox repository" at "http://dl.dropbox.com/u/18533645/repository/"
- val morphiaRepository = "Morphia repository" at "http://morphia.googlecode.com/svn/mavenrepo/"
- }
-
-}
@@ -5,4 +5,4 @@ logLevel := Level.Warn
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
-addSbtPlugin("play" % "sbt-plugin" % "2.0")
+addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
@@ -27,17 +27,17 @@ public void run() {
post.insert();
ObjectId id = post.id;
- post = Post.find.byId(id);
+ post = Post.find().byId(id);
GridFSDBFile gridFSDBFile = post.picture.getGridFSFile();
assertThat(gridFSDBFile).isNotNull();
assertThat(post.title).isEqualTo("fake post");
- assertThat(Post.find.byId(post.id).id).isEqualTo(post.id);
- assertThat(Post.find.byId(post.id).title).isEqualTo(post.title);
- assertThat(Post.find.asList().size()).isGreaterThan(0);
+ assertThat(Post.find().byId(post.id).id).isEqualTo(post.id);
+ assertThat(Post.find().byId(post.id).title).isEqualTo(post.title);
+ assertThat(Post.find().asList().size()).isGreaterThan(0);
post.title = "real title";
post.update();
- assertThat(Post.find.byId(post.id).title).isEqualTo(post.title);
+ assertThat(Post.find().byId(post.id).title).isEqualTo(post.title);
}
});
}

0 comments on commit ab70910

Please sign in to comment.