public static void flush(final EntityManager em) {
getInstance().flushEm(em);
}
public static EntityManager create(final String unitName) throws Exception {
final BeeGenericEntityFactory factory = BeeEntityFactoryRepository.getInstance().get(unitName);
if (null == factory) {
throw new Exception(StringUtils.format(
"Factory not registerd: '%s'",
unitName));
}
final EntityManagerFactory emf = factory.getFactoryWrapper();
return getInstance().createEm(emf);
}