* @param container
* @param expected
*/
private <X,V extends ManagedType<?>> void instantiate(Class<X> cls, ClassMetaData meta,
Map<Class<?>,V> container, PersistenceType expected) {
PersistenceType actual = getPersistenceType(meta);
if (actual != expected) {
if (!meta.isEmbeddable() || actual != PersistenceType.ENTITY ||
expected != PersistenceType.EMBEDDABLE)
throw new IllegalArgumentException( _loc.get("type-wrong-category",
cls, actual, expected).getMessage());