mercredi 1 juillet 2015

Play Framework Database and Java Persistence

I am very, very new to the Play! framework (for Java), and because I will need it to do a database project in my class, I have to learn it as fast as possible, so please bear with me if I ask some dumb questions here. I'm following a tutorial, but I have a problem. I have searched everywhere, but I couldn't find answers.

1) In the tutorial, all the actions in the controller are defined as static methods, but when I declare methods as static and run the app, I receive error that they are not a member of controller. I know the solution is to remove static, but I was wondering why is there this difference?

2) This is my main problem: in the tutorial, when connecting to the database:

  • He creates a class and adds javax.persistence.Entity annotation
  • The class extends play.db.ebean.Model class
  • He adds the javax.persistence.Id annotation to the ID field

My problem is that I don't have access to these classes. Can anyone suggest a solution please? I'm really stock!

Thank you in advance

Aucun commentaire:

Enregistrer un commentaire