当使用带有hibernate的spring作为jpa提供程序时,对象/实体生命周期与直接使用hibernate或hibernate定义的对象/实体生命周期相同(或者可能是jpa规范本身)。
Hibernate将这些生命周期定义为实体- Transient, Persistent, Detached, Removed。当使用spring时,这些相同的生命周期也适用吗?如果是这样的话,下面是Hibernate提供的方法以及spring存储库的方法。
//below methods in hibernate move an entity to persistent state
save(e), 
persist(e);  
update(e);  
saveOrUpdate(e);  
lock(e);  
merge(e);  和
//below methods in hibernate move an entity to detached state
detach(e);  
evict(e);  https://stackoverflow.com/questions/65262120
复制相似问题