title: How to Create TableRecord Object?
body: <p>i was trying to create method <strong>(Which is a common method so that i can pass any Table class object to it )</strong>  like below which will take <code>List</code> of <code>TableRecord</code> as a argument and get table name and column names as well so i am doing below code .</p>
  
  <pre><code>public void getColumns(List&lt;TableRecord&gt; records){
      for(TableRecord record : records){
          Table table = record.getTable();
  
          Field[] fields = table.fields();
          for(Field field : fields){
              field.getName();
              record.getValue(field);
  
          }
      }
  }
  </code></pre>
  
  <p>but my question here how to create a object of <code>TableRecord</code> class? so that i can call the above method and pass <code>List</code> of <code>TableRecord</code> object.</p>
  
  <p>I was trying a generic method which will get  <a href="http://grepcode.com/file/repo1.maven.org%24maven2@org.jooq%24jooq@3.0.1@org%24jooq%24TableRecord.java" rel="nofollow">TableRecord</a>  object and return the database table name and all the column's that table have . I have to use <code>TableRecord</code> or any other object for this and how to create that object?</p>
  
  <p>I can not do something like this </p>
  
  <pre><code>TableRecord record = new  TableRecord()
  </code></pre>
  
  <p>because it already a interface then how to create object? Or i have to pass another class to method?</p>
  
  <p><strong>EDIT :-</strong></p>
  
  <p>If you will see my code you can check method taking <code>List</code> of <code>TableRecord</code> as a argument so that this <code>List</code>  can take any DB table JOOQ class like <code>LoginRecord.java</code>,<code>EmpRecord.java</code> etc. So method is not generic and its broad, developer can pass any type of Jooq created table class object by this. Now i have '<code>List&lt;TableRecord&gt;</code>' object now i have to get columnName or fieldName and their value i mean data those fields contain, so that i can set data to another bean class which will interact with UI.</p>