title: In play 2.0.3, I have 'sets' of images that I want to categorise and put in the database when I start the server
body: <p>I need a site for my work as goldsmith and since I have 'some' programming experience I thought I'd do it myself, it would just be a site to display some images of my work and basic contact info.</p>
  
  <p>What I'm trying to do is basically this:</p>
  
  <p>I put my images/renders of jewels in a folder structure like this</p>
  
  <pre><code>- public
  - - images
  - - - creations
  - - - - JewelSet1
  - - - - - Jewel1
  - - - - - - img1
  - - - - - - img2
  - - - - - - img3
  - - - - - Jewel2
  - - - - JewelSet2
  - - - - - Jewel3
  - - javascripts
  - - stylesheets
  </code></pre>
  
  <p>And when the <code>public static Result index()</code> method is called for the first time, it should search trough public/images/creations and categorise the folders into three objects I made, namely: CreationSet, Image and Creation, which are basically:</p>
  
  <pre><code>package models;
  
  import java.awt.image.BufferedImage;
  import play.db.ebean.Model;
  import play.data.validation.Constraints;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  @Entity
  public class Image extends Model{
      @Id
      public String id;
  
      @Constraints.Required
      public BufferedImage img = null;
  
      @Constraints.Required
      public String desc;
  }
  </code></pre>
  
  <hr>
  
  <pre><code>@Entity
  public class Creation extends Model {
      @Id
      public String id;
  
      @Constraints.Required
      public String name;
  
      @Constraints.Required
      public String desc;
  
      public List&lt;Image&gt; images = new ArrayList&lt;Image&gt;();
  
      public void addImage(int priority, Image img){
          images.add(priority, img);
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>@Entity
  public class CreationSet extends Model {
      @Id
      public String id;
  
      @Constraints.Required
      public String name;
  
      @Constraints.Required
      public String desc;
  
      public List&lt;Creation&gt; creations = new ArrayList&lt;Creation&gt;();
  
      public void addCreations(int priority, Creation creation){
          creations.add(priority, creation);
      }
  }
  </code></pre>
  
  <p>Then go trough the lists of <code>CreationSet</code>s and generate the right HTML in the html-templates</p>
  
  <p>Is this the right way to go? Or how should I do it?</p>