Fixed sort order bug in Db Entity class