package kz.cafe.db.model;

import kz.cafe.constants.*;
import kz.cafe.db.model.anotations.*;
import org.bson.types.*;
import com.google.code.morphia.annotations.*;

public abstract class MAbstractDataElement implements java.io.Serializable{
   private static final long serialVersionUID = -8481060095754163216L;
   
   @AnnotationNotExported
   public static final String F_ID           = "ID";
   @AnnotationNotExported
   public static final String F_DELETED      = "deleted";
   
   
   @AnnotationNotExported
   public static final String F_OWNER_ID     = "ownerID";
   @AnnotationNotExported
   public static final String F_OWNER_LOGIN  = "ownerLogin";
   
   
   @AnnotationNotExported
   public static final String F_CREATED      = "created"; 
   
   
   
   @Id
   @AnnotationNotExported
   public ObjectId _id; // auto-generated, if not set (see ObjectId)
   
   @Version
   @AnnotationNotExported
   public long _version;

   
   @Indexed(unique=true)
   public int ID;
   
   
   @AnnotationRelated(foreign = MUser.class)
   @Indexed
   public int ownerID = 0;
   
   
   @AnnotationDate
   public long created = System.currentTimeMillis();
   
   @AnnotationNotExported
   @Indexed()
   public boolean deleted = false;
   
   
   public String humanReadable(InterfaceConstants.LANGS lang){
      return this.getClass()+ " [" + ID + "]";
   }
}
