@SuppressWarnings("rawtypes")
private static void loadDynamicClassIntoKundera(String persistenceUnit, Class<?> clazz, Map config) {
// Add the metadata by hand to all the right places
// 0] Create the metadata:
MetadataBuilder kunderaBuilder = new MetadataBuilder(persistenceUnit, (String) config.get("kundera.nodes"), config);
EntityMetadata myMeta = kunderaBuilder.buildEntityMetadata(clazz);
// 1] class -> persitence unit:
Map<String, List<String>> clazzHack = new HashMap<String, List<String>>();
clazzHack.put(clazz.getName(), Arrays.asList(persistenceUnit));
KunderaMetadata.INSTANCE.getApplicationMetadata().setClazzToPuMap(clazzHack);
// 2] PU -> class: