package models;

import java.util.List;
import java.util.UUID;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * The base class for all of the models used by GTFS Data Manager.
 * We don't use the Play model object because we're not saving things to a relational database.
 * @author mattwigway
 */
public abstract class Model {
 
    public Model () {
        this.id = UUID.randomUUID().toString();
    }
    
    public String id;
    
    /**
     * The ID of the user who owns this object.
     * For accountability, every object is owned by a user.
     */
    @JsonIgnore
    public String userId;
    
    /**
     * Notes on this object
     */
    public List<Note> notes;
    
    /**
     * Get the user who owns this object.
     * @return the User object
     */
    public User getUser () {
        return User.getUser(userId);
    }
    
    /**
     * Set the owner of this object
     */
    public void setUser (User user) {
        userId = user.id != null ? user.id : User.getUserId(user.username);
    }
}

@@ -57,16 +57,60 @@
 .UUID;%0A%0A
+import javax.persistence.MappedSuperclass;%0A%0A
 import c
@@ -347,16 +347,34 @@
 way%0A */%0A
+@MappedSuperclass%0A
 public a
@@ -473,24 +473,28 @@
 ;%0A    %7D%0A    
+    
 %0A    public 

Add @MappedSuperclass so user information is serialized.