use metadata to figure out entity name