摘要:
Hibernate Object state: 对象状态1. Transient Objects临时对象Objects instantiated using the new operator aren't immediately persistent. Their state is transient, which means they aren't associated with any database table row, and so their state is lost as soon as they're dereferenced.新生成的对象, Sess 阅读全文
摘要:
hibernate的保存hibernate对于对象的保存提供了太多的方法,他们之间有很多不同,这里细说一下,以便区别:一、预备知识:在所有之前,说明一下,对于hibernate,它的对象有三种状态,transient、persistent、detached下边是常见的翻译办法:transient:瞬态或者自由态persistent:持久化状态detached:脱管状态或者游离态游离状态的实例可以通过调用save()、persist()或者saveOrUpdate()方法进行持久化。持久化实例可以通过调用 delete()变成脱管状态。通过get()或load()方法得到的实例都是持久化状态的。 阅读全文