// Path: server/app/models/Phone.java
// @Entity
// public class Phone extends Model {
// 
// 	public String imei;
// 
// 	public String unitId;
// 	
// 	public String userName;
// 	
// 	public Date registeredOn;
// 	
// 	public static Phone registerImei(String imei, String userName) {
// 		
// 		// check for existing imei record
// 		Phone phone = Phone.find("imei = ?",  imei).first();
// 		if(phone != null)
// 			return phone;
// 		
// 		// create a new record
// 		
// 		phone = new Phone();
// 		
// 		// generate "random" six digit unit ID
// 		Random generator = new Random();  
// 		generator.setSeed(System.currentTimeMillis());  
// 		
// 		Integer id = 0;
// 
// 		do {
// 			id = generator.nextInt(899999) + 100000;
// 		} while(Phone.count("unitId = ?", id.toString()) > 0);
// 		
// 		phone.unitId = id.toString();
// 		phone.imei = imei;
// 		phone.userName = userName;
// 		phone.registeredOn = new Date();
// 		
// 		phone.save();
// 		
// 		return phone.save();
// 	}
// 
// }


import java.math.BigInteger;
import java.util.Date;
import javax.persistence.EntityManager;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Entity;
import javax.persistence.Query;
import models.Phone;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.Type;
import com.vividsolutions.jts.geom.MultiLineString;
import play.db.jpa.Model;
package models.transit;







@JsonIgnoreProperties({"entityId", "persistent"})
@Entity
public class Route extends Model {

	public String gtfsRouteId;
    public String routeShortName;
    public String routeLongName;
    public String routeDesc;
    public String routeNotes;

    @Enumerated(EnumType.STRING)
    public RouteType routeType;

    public String routeUrl;
    public String routeColor;
    public String routeTextColor;
    
    public String vehicleCapacity;
    public String vehicleType;
    
    public Date captureTime;

    // Custom Fields
    public Boolean airCon;
    public String comments;

    public Boolean weekday;
    public Boolean saturday;
    public Boolean sunday;

    @ManyToOne
    public Agency agency;
    
    @ManyToOne
// Path: server/app/models/Phone.java
// @Entity
// public class Phone extends Model {
// 
// 	public String imei;
// 
// 	public String unitId;
// 	
// 	public String userName;
// 	
// 	public Date registeredOn;
// 	
// 	public static Phone registerImei(String imei, String userName) {
// 		
// 		// check for existing imei record
// 		Phone phone = Phone.find("imei = ?",  imei).first();
// 		if(phone != null)
// 			return phone;
// 		
// 		// create a new record
// 		
// 		phone = new Phone();
// 		
// 		// generate "random" six digit unit ID
// 		Random generator = new Random();  
// 		generator.setSeed(System.currentTimeMillis());  
// 		
// 		Integer id = 0;
// 
// 		do {
// 			id = generator.nextInt(899999) + 100000;
// 		} while(Phone.count("unitId = ?", id.toString()) > 0);
// 		
// 		phone.unitId = id.toString();
// 		phone.imei = imei;
// 		phone.userName = userName;
// 		phone.registeredOn = new Date();
// 		
// 		phone.save();
// 		
// 		return phone.save();
// 	}
// 
// }


// Path: server/app/models/transit/Route.java
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.EntityManager;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Entity;
import javax.persistence.Query;
import models.Phone;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.Type;
import com.vividsolutions.jts.geom.MultiLineString;
import play.db.jpa.Model;

package models.transit;







@JsonIgnoreProperties({"entityId", "persistent"})
@Entity
public class Route extends Model {

	public String gtfsRouteId;
    public String routeShortName;
    public String routeLongName;
    public String routeDesc;
    public String routeNotes;

    @Enumerated(EnumType.STRING)
    public RouteType routeType;

    public String routeUrl;
    public String routeColor;
    public String routeTextColor;
    
    public String vehicleCapacity;
    public String vehicleType;
    
    public Date captureTime;

    // Custom Fields
    public Boolean airCon;
    public String comments;

    public Boolean weekday;
    public Boolean saturday;
    public Boolean sunday;

    @ManyToOne
    public Agency agency;
    
    @ManyToOne
    public Phone phone;