ColumnNotFound

10 views
Skip to first unread message

José Leal

unread,
Jul 28, 2011, 11:23:26 AM7/28/11
to play-framework
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:

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)
);

The model:

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]

And the piece of 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" -> username).as(comments ~< usr *)


Can anyone help me? Thank you!
Reply all
Reply to author
Forward
0 new messages