In hibernate, we often use the delete method of session. When using this method, we must pay attention to delete. Delete can only delete objects with ID attributes in memory. If we create a new object, but no Perform a persistence operation on it, as long as there is an ID in the database that is the same as the ID of this object, then even if this object is not persisted, the object with the same ID in the database will also be deleted. . .
hibernate's delete method
Guess you like
Origin blog.csdn.net/nanxiaotiantian/article/details/9263641
Ranking