title: Serialization of domain objects in MapDB
body: <p>In my mapdb application, for example,  I have a simple domain object Course:</p>
  
  <pre><code>import java.io.Serializable;
  
  class Course implements Serializable {
    private static final long serialVersionUID = 1L;
    String cID;
    String name;
    String teacherName;
    String departmentName;
    public Course(String name) {
      this.name = name;
      System.out.println("Update: added course \"" + name);
    }
  }
  </code></pre>
  
  <p>By trial and error I added the implements Serializable, the serialVersionID and my own domain key, cID. All seems to work. But here's my code to store that into MapDB:</p>
  
  <pre><code>NavigableMap&lt;String, Course&gt; courses;
  courses = db.treeMap("courses", Serializer.STRING, Serializer.JAVA).createOrOpen();
  </code></pre>
  
  <p>Which gives a warning:</p>
  
  <pre><code>Type safety: The expression of type BTreeMap needs unchecked
  conversion to conform to NavigableMap&lt;String,Course&gt;
  </code></pre>
  
  <p>I don't understand that error, but I believe it has to do with my serialization as Serializer.JAVA. What is going on, or what I am doing wrong? </p>