How can I fetch entities that has not been saved into another table?

You can use Sql condition to add the condition part in raw SQL, as described in these Support Center topics: