Search code examples
playframeworkmodels

Play! framework subfolders in the "models" one?


Assume the following flat models structure (models folder content):

  • user.java
  • group.java
  • log.java
  • car.java
  • motorbike.java

For clarity purpose, I would like to "classify" those models files into subfolders to get the following:

  • general
    • user.java
    • group.java
    • log.java
  • vehicules
    • car.java
    • motorbike.java

I tried to create two folders into the genuine "models" one and adapted the package import accordingly i.e. package models.general; for instance. I then ran the project, the database is created properly (the tables are generated) but I'm unable to save anything. Is there something I missed ?


Solution

  • I don't know if that solves the problem, but from what you describe, the correct packages would be models.general and models.vehicules.