In the database used by my application I have a table that I defined as temporary that I write some data but at the end of the process I no longer need the information registered in that table, how should I make this table be cleaner would it be more useful to carry out a process via the database or the application itself should take care of it.?
I use Hibernate
and tried some situations but I can do em.remove(temp);
from a defined object, not all content.
An example of how I search the bank:
public EntityManager getEntityManager() {
return ConexaoJPA.getEntityManager();
}
public List find(int id) {
EntityManager em = getEntityManager();
try {
Query q = em.createQuery("from Temp where cod=" + id + "");
return (List<Temp>) q.getResultList();
} finally {
em.close();
}
}