Add query test cases for sorting
fix entity date when initializing the datas