PersistenceManager pm = PMF.get().getPersistenceManager();
try {
Query query = pm.newQuery(Weekplan.class, "mensa == m && week == w && year == y");
query.declareParameters("Mensa m, int w, int y");
List<Weekplan> weekplans = (List<Weekplan>) query.execute(mensa, week, year);
pm.deletePersistentAll(weekplans);
pm.flush();
} catch (JDOUserException e) { }
finally {
pm.close();
}