Eveything works well as my expected. different EMF can be created for different tenant.

But the problem is one EMF per tenant is two heavy, I want to share the "public" metadata which is annotated in class A. The "private" metadata will be got at rumtime for different tenant. Is it possible?

When developing an application that can handle requests from multiple tenants you can choose to have a single EntityManager Factory (EMF) with tenant scoped EntityManagers (EM) or you can choose to have a EMF per tenant.

If you want different tenants to have different metadata, then I can't see any other way than having multiple EMFs.

What do you mean by too heavy?

You can have a single EMF if all tenants share the same metadata.

If the are some classes that are shared, and others that have there own metadata, then you could have one shared persistence unit for the common data, and another separate persistence unit that used extended metadata.