title: How to override static variables from inherited derived classes in typescript
body: <p>I'd like to have the the static implementation of a static method use the derived class's value.  For example, in the simple example below, when I call <code>User.findById()</code> I want it to use the overridden tableName <code>User</code> when executing the implementation defined in the base class SqlModel.</p>
  
  <p>How do I make sure that the base classes static tableName uses 'User' and is this the right way of essentially declaring an abstract static property?</p>
  
  <pre><code>class SqlModel {
  
      protected static tableName:string;
  
      protected _id:number;
      get id():number {
          return this._id;
  
      }
  
      constructor(){
  
      }
  
      public static findById(id:number) {
          return knex(tableName).where({id: id}).first();
      }
  
  }
  
  export class User extends SqlModel {
  
      static tableName = 'User';
  
      name:string;
  
      constructor(username){
          this.name = username;
      }
  }
  </code></pre>
  
  <p>And I would get an error saying tablename is not defined, but if I say SqlModel.tableName then it doesn't use the derived classes table name</p>
  
  <pre><code>User.findById(1); //should call the knex query with the tablename 'User'
  </code></pre>