2
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 recorded in that table, how to make this table clean would be more useful to carry out a process via database or the application itself should take care of this.?
I use the Hibernate
and tried some situations but I can do the em.remove(temp);
from a defined object, and not from the whole content.
An example of how I do a database search:
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();
}
}
So, did you succeed? If yes, consider including your solution, you can help other people.
– Bruno César
I couldn’t, I’m checking the Hibernate documentation to see if I can get something more accurate.
– DevAgil
What happens to the suggestions below, someone? Can debug and see what’s happening, or provide a reproducible example of what you’re doing?
– Bruno César