title: JavaFX: Create a dynamic tableview with generic types
body: <p>So, first of all, my code is based on the accepted answer in <a href="https://stackoverflow.com/questions/18941093/how-to-fill-up-a-tableview-with-database-data">this thread.</a></p>
  
  <p>I'm trying to create a tableview from a database, and this tableview should be populated dynamically based on what data the user asks for. While that's working so far, my problem is that all values gathered from the database are interpreted as strings in java, but I need their actual values. </p>
  
  <p>The reason for this is that the built-in sorting mechanism of the javafx tableview sorts all numbers as strings because their type is converted to string when populating the table.</p>
  
  <p>Example:
  Values 
  921, 200, 110, 1, 2011, 1299 
  would be sorted as (using integer datatype) 1, 110, 200, 921, 1299, 2011
  while it would be sorted as 1, 110, 1299, 200, 2011, 921 using string datatype.</p>
  
  <p>I'm quite new to generics and java in general, and hope someone here might be able to help me out.</p>
  
  <p>Basically: whenever I read a value from the database, I need to insert the value in the tableview with its actual datatype, rather than it being converted to string.</p>