Converting table to entity