model « playframework « Java Enterprise Q&A





1. save() and _save() model's methods in playframework    stackoverflow.com

When create playramework's model we can use save() or _save() method. Why these both methods are avalible in the framework, what's the reason? (in this context they do the same - ...

2. Use Map as property of model in Play    stackoverflow.com

I'm trying to use a Map as a type for one of my models properties. Let's take these two classes for example:

@Entity
public class Foo extends Model {

    @OneToMany(mappedBy ...

3. Help cannot calling non-static method model in play framework controller?    stackoverflow.com

I've been following play framework 1.1.1 YABE adding comment tutorial then ends up with this problem. the problem is this error message appears Compilation error The file /app/controllers/Application.java could not be compiled. Error ...

4. Play! - unique model field    stackoverflow.com

How can I make my model class fields unique? Eg. if login is already taken, I'd like to display proper message for the user. I have to write my own validation ...

5. Creating complex business logic in a model    stackoverflow.com

Im kind of new to MVC. My question is how do you design an application and implement it with complex logic. I'm using the Play framework, creating a java web app. Rather ...

6. Filtering crud list problem play! framework    stackoverflow.com

it's my first post here :) I have a problem with the CRUD module. I want to add more filter on the list but I don't success to understand the Factory ...

7. How to get inheritance to work in my model layer?    stackoverflow.com

I know that you should extend Model to get all the jpa functionality. However, java does not allow multiple inheritance... Therefore, I would like to know how to architect in play ...

8. A good data model for storing score and history for a game    stackoverflow.com

I am developing a little game (I'm using Play! framework). In this game, the players answer technical questions, and win points when they answer correctly. In addition to that, they may win some ...

9. use of public variable in Play! framework model    stackoverflow.com

I came across Play! framework a few days ago.It is mentioned that public variable are used as instance variables in Model.All my life, I have been told that it was a ...





10. Sharing data models among separate but related sites    stackoverflow.com

I am working on the design for a series of websites built on the Play! Framework and Scala. Each site will have its own data models, but they will also need ...

11. calling genericmodel validateAndSave method won't have the record id autogenerated    stackoverflow.com

I have the following code that create/save a user record, the database is the default (H2 in memory) database. I expect that, after calling validateAndSave (of GenericModel) API on the user ...

12. Should authorization be part of the model or controller?    stackoverflow.com

I'm writing a web application with some ACL requirements: a user can make changes to some items, some items may be editable by several users, administrator can edit anything and a ...

13. How to add @Expose to an id model without rewriting the original id?    stackoverflow.com

Using GSon, I'd like to show the id of my model when transforming it to JSON. But I don't want all my model to have the id exposed. Do I have to rewrite ...

14. Play!Framework : using find() model method on a collection    stackoverflow.com

Let's assume a User class with theese fields :

@Entity
public class User extends Model {
    public String email;
    public String password;
    @ElementCollection
  ...

15. Play Framework - How to Query a Model using 'IN'?    stackoverflow.com

How can I get the same results in Play Framework's Model Queries?

SELECT * FROM MyModel WHERE status IN (1, 5, 8) ORDER BY createdAt;

16. How to update an Object in play framework?    stackoverflow.com

How do I edit an existing object in the database? For example, if I have a model like this: class Topic{title,content,author}, when I edit and save the object I do ...





17. Play Framework: Impact of Jobs on the stateless model    stackoverflow.com

One of the great things about the Play framework is that it is fully stateless and only request/response-oriented. This is really nice since it allows me to deploy my app to ...

18. How to quickly generate models in play framework 1.2?    stackoverflow.com

Does play framework have anything like quickly generator of models by schema? I like symfony + doctrine infrastructure, but I can't use it in this case =\ PS. Thanks for answers =) ...

19. Play-Framework: ClassCastException occured : java.util.LinkedHashMap cannot be cast to models.Systems    stackoverflow.com

I'm attempting to iterate a List of objects. like so..

for(System s : usersSystems){

}
Where usersSystems is of type List<UserSystems>. usersSystems is a fairly simple class simply consisting of a constructor...
public UsersSystems(System ...

20. How to inherit a model from superclass in playframework    stackoverflow.com

I'm trying to understand how does the inheritance work in play! But unsuccessfully yet. So, I have such superclass:

@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)  
abstract class SuperClass extends Model {  
   ...

21. Play Framework The type ... is already defined    stackoverflow.com

when i try to run my Application it gives me following error:

Compilation error
The file /app/models/setting.java could not be compiled. Error raised is : The type Setting is already defined
  • I do have ...