package Common.Database.Objects;
import Common.Utils.Utils_;
import com.sun.org.glassfish.gmbal.Description;
public abstract class nDBObject extends DBObject {
    @Description("PRIMARY KEY, UNIQUE")
    public String id = "";
    public nDBObject(nDBObject src) {
        this.SynchronizeFields(src);
    }
    public nDBObject() {
    }
    @Override
    public Object getPK() {
        return id;
    }
    @Override
    public Object getEmptyFK() {
        return "";
    }
    public String getFKName() {
        return getClass().getSimpleName().toLowerCase() + "_id";
    }
    public void genName() {
        id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
    }
    //-
    @Override
    public void SynchronizeFields(DBObject src) {
        super.SynchronizeFields(src);
        id = ((nDBObject) src).id;
    }
}
