0
鉴于您拥有大量的域对象,它们都相互交互,因此了解哪些对象在特定事务中发生了更改会非常有用。休眠事务信息
这可能吗?我想基本上这样做:
public void someBusinessLogicMethod(someparams) {
Session s = getSession();
Transaction tr = s.beginTransaction()
domainObject = s.load(...)
domainObject.setSomethingOrOther(...);
domainObject.getSomeLink().setSomethingElse(...);
callSomeOtherBusinessLogicMethod();
tr.commit();
/* at this point many objects have changed, Hibernate knows which ones */
for (Object s : tr.getAffectedObjects(?)) {
....
}
}
这是否存在?
_at此时许多对象已经改变,Hibernate知道哪些是_ ---你是suuuuure吗? – 2010-10-17 17:16:19
为什么这很有用?你为什么需要这个?根据答案,可能有解决方案,但你需要澄清。 – 2010-10-17 19:42:39