Keep in mind that unless you want to access the outer class (called
Outer) below, you should probably use the static class modifier on the
inner class (MyModel). In general, if you want a compound result you
want to use the static class modifier. You only exclude the static
modifer if your inner class has a reference to the outer class (eg,
say MyModel wanted to access aString) which is something I'd recommend
against since it is a recipe for spaghetti code.
So, to be clear:
static public class MyModel extends Model {
This example code below makes me wonder though - I'm not sure I would
ever stick a model class as an inner class (also it is missing
@Entity) - I might go the other way around though and have something
like
static public class Result { public Long value; public String value2; }
Also, be careful with methods in classes that extend Controller - they
are heavily bytecode modified and don't behave as normal java calls.
For example, calling another static method in a controller will cause
a browser redirect. Keep controller code simple - and put all your
logic in service or model classes.
Tom
> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/play-framework/-/uNEngKcfVa4J.
>
> To post to this group, send email to
play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
>
play-framewor...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/play-framework?hl=en.