/**
*
*/
package de.peacei.gae.foodsupplier.data.dao;
import javax.jdo.PersistenceManager;
import com.google.inject.Singleton;
import de.peacei.gae.foodsupplier.data.TaskName;
import de.peacei.gae.foodsupplier.util.PMF;
/**
* @author peacei
*
*/
@Singleton
public class TaskNameDAO {
public TaskNameDAO() { }
public TaskName getTaskName(String id) {
TaskName taskName = null;
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
taskName = pm.getObjectById(TaskName.class, id);
} catch(Exception e) { }
return taskName;
}
public void saveTaskName(TaskName taskName) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.makePersistent(taskName);
pm.flush();
} catch(Exception e) { }
finally {
pm.close();
}
}
public void deleteTaskName(String id) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
TaskName taskName = pm.getObjectById(TaskName.class, id);
pm.deletePersistent(taskName);
pm.flush();
} catch(Exception e) { }
finally {
pm.close();
}
}
}