Hey guys, thanks for the responses!
@Antoine, I made the same environment and I still get the error:
play.exceptions.JavaExecutionException: ColumnNotFound(
comments.id)
I'm using play 1.2.2 with scala-play 0.9.1 mysql 5.1.54.
You think is because of the Mysql version?
@Guillaume, yes.
Any tracks for Postgres support? My boss is really bugging me on this
one.. and I'm almost migrating to Scala-query.
Thank you!
On 29 Jul., 12:08, Antoine Michel <
a...@zenexity.com> wrote:
> Your code works for me on MySQL 5.5.14, play 1.2.x, play-scala master.
>
> With this code :
> *evolutions :*
> create table usr (
> id bigint(20) NOT NULL AUTO_INCREMENT,
> ccall varchar(255) NOT NULL,
> PRIMARY KEY (id)
> );
>
> 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)
> );
>
> *models :*
> case class usr(
> id: Pk[Long],
> ccall: String
> )
> object usr extends Magic[usr]
>
> 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)}
>
> object comments extends Magic[comments] {
> 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 *)
>
> }
>
> *test :*
> def test1 = {
> usr.create(usr(NotAssigned, "usr"))
> comments.create(comments(NotAssigned, "usr", "usr", "test", 0))
> comments.create(comments(NotAssigned, "usr", "usr", "test2", 0))
> comments.loadComments("usr")
>
> }
>
> *result :*
> List((|2| |usr|, |usr|, |test|~usr(2,usr)), (|3| |usr|, |usr|,
> |test2|~usr(2,usr)))
> *
> *
> Do you see any differences?
>
> On Fri, Jul 29, 2011 at 11:22 AM, Guillaume Bort
> <
guillaume.b...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Do you have exactly the same Table and Column names between H2 and MySQL?
>
> > On Fri, Jul 29, 2011 at 9:46 AM, José Leal <
domingu...@gmail.com> wrote:
> > > Guys,
>
> > > can anyone give me some pointers about using Magic and Mysql? I'm
> > > getting some ColumnNotFound errors and it use to work in the Mem db.
> > > Anyone had this problem as well??
>
> > > My specific problem is the following:
>
> >
http://groups.google.com/group/play-framework/browse_thread/thread/4b...
> > Guillaume Bort,
http://guillaume.bort.fr