Scala models

4 views
Skip to first unread message

Bart Schuller

unread,
Nov 9, 2009, 5:32:49 PM11/9/09
to play-framework
Hi,

In a 1.1 branch near you (lp:~schuller-lunatech/play/1.1-scala-
tutorial at the moment) there is now support for writing models in
Scala. I thought it was already working a few days ago, until today a
test failed with "Can't find property with name 'comments' on class
models.Post".

This could be solved in two different ways. The first would be to say
that every Scala model would have to use @BeanProperty annotations.
But that would make them ugly. So I chose the second, which was to
teach play about Scala setters. That's what's in my branch now. I hope
you like it.

The second part of the tutorial is also done, now linked from the
Scala page. I may come back to this part later, because the
AssertNotNull tests reminded me that Scala can be used to do away with
nulls using the Option type.

Until the next part,

--
Bart.S...@gmail.com

phausel

unread,
Nov 9, 2009, 5:38:30 PM11/9/09
to play-framework
good job! is the CRUD module working with scala models? that was the
next issue on my list:) P
> Bart.Schul...@gmail.com

Nilanjan

unread,
Nov 9, 2009, 10:06:02 PM11/9/09
to play-framework
Using scala setter will cause other problems like loading data from
fixtures. Just wondering whether should we use @BeanProperty after
all.
But the problem is I am not sure specify multiple annotations to a
given field like

@OneToMany
@BeanProperty

This didn't work for me

Nilanjan

Bart Schuller

unread,
Nov 10, 2009, 2:34:37 AM11/10/09
to play-fr...@googlegroups.com

On Nov 10, 2009, at 4:06, Nilanjan wrote:

> Using scala setter will cause other problems like loading data from
> fixtures. Just wondering whether should we use @BeanProperty after
> all.

That's the thing: the test that failed which prompted my change was
indeed loading yaml data. So I know that works.

As for CRUD: I haven't tried it yet, but I think it may just work now.


--
Bart.S...@gmail.com

Guillaume Bort

unread,
Nov 10, 2009, 4:49:27 AM11/10/09
to play-fr...@googlegroups.com
Good stuff. I will look forward to merge it in the main branch today.

Nilanjan

unread,
Nov 10, 2009, 10:57:05 PM11/10/09
to play-framework
Is this available in main branch now?

On Nov 10, 4:49 am, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Good stuff. I will look forward to merge it in the main branch today.
>
> > Bart.Schul...@gmail.com

Guillaume Bort

unread,
Nov 11, 2009, 7:06:10 AM11/11/09
to play-fr...@googlegroups.com
Yes.

Nicolas

unread,
Nov 11, 2009, 8:45:58 AM11/11/09
to play-framework
It is really in now ;)

Guillaume Bort

unread,
Nov 11, 2009, 9:11:02 AM11/11/09
to play-fr...@googlegroups.com
Ah ok. Sorry ...
Reply all
Reply to author
Forward
0 new messages