Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- entityManagerFactory = Persistence.createEntityManagerFactory("myPersistence-unit");
- EntityManager entityManager = openEntityManager( entityManagerFactory);
- entityManager.getTransaction().begin();
- String queryDropCollection = "db.Person.drop()";
- String queryDropDB = "db.dropDatabase()";
- entityManager.createNativeQuery(queryDropCollection).executeUpdate();
- entityManager.createNativeQuery(queryDropDB).executeUpdate();
- entityManager.getTransaction().commit();
- entityManager.close();
- Exception in thread "main" com.mongodb.util.JSONParseException:
- db.Person.drop()
- ^
- Exception in thread "main" com.mongodb.util.JSONParseException:
- db.dropDatabase()
- ^
Add Comment
Please, Sign In to add comment