Note that there are some explanatory texts on larger screens.

plurals
  1. POColumnNotFound problem with Magic in play scala
    text
    copied!<p>I'm getting a "play.exceptions.JavaExecutionException: ColumnNotFound(comments.id)" in a piece of code after trying to migrate to MySql instead of the memorydb. Postgres support by Magic is almost null. The evolution: </p> <pre><code>create table comments ( id bigint(20) NOT NULL AUTO_INCREMENT, source varchar(255) NOT NULL, target varchar(255) NOT NULL, content text NOT NULL, date bigint NOT NULL, PRIMARY KEY (id) ); </code></pre> <p>The model: </p> <pre><code>case class comments(id: Pk[Long], source: String, target: String, content: String, date: Long) { override def toString = "|%s| |%s|, |%s|, |%s|".format(id.toString, source, target, content) lazy val formattedDate = new SimpleDateFormat("dd.MM.yyyy HH:mm") format date } object comments extends Magic[comments] </code></pre> <p>And the piece of code: </p> <pre><code>def loadComments(username: String) = SQL("""select c.*, u.* from comments c, usr u where c.source = u.ccall and c.target = {ccall} order by c.date desc""").on("ccall" -&gt; username).as(comments ~&lt; usr *) </code></pre> <p>Can anyone give me some pointers? I'm really stuck on this.. Here is the stacktrace:</p> <pre><code>play.exceptions.JavaExecutionException: ColumnNotFound(comments.id) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:228) at Invocation.HTTP Request(Play!) Caused by: java.lang.RuntimeException: ColumnNotFound(comments.id) at scala.Predef$.error(Predef.scala:58) at play.db.anorm.Sql$.as(Anorm.scala:984) at play.db.anorm.Sql$class.as(Anorm.scala:919) at play.db.anorm.SimpleSql.as(Anorm.scala:829) at controllers.Profile$.loadacomments(Profile.scala:21) at controllers.Profile$.loadacommentsWithLikes(Profile.scala:46) at controllers.Profile$.comment(Profile.scala:91) at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:543) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:493) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:470) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158) </code></pre> <p>Thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload