1. before invalidate the session, it's necessary to check whether the session is still valid,
HttpServletRequest supply one method called: isRequestedSessionIdValid()
this method will check whether the current session is still valid, and if yes, return true, else, return false.
2. For the use of 'Set' in hibernate.
if one POJO has one set and the cascade has been set to 'true' in the hibernate mapping file
so for one POJO, let's say, there is instance O1 and O2 in the set. while in usage, if we reset the 'Set' with one new set, and add O1 and O2 into the set, and save/update the POJO. what's the process of save the set? you should be surprised to see the process is that: 1. delete O1 and O2 from db 2. save O1 and O2 to db.
so that's the process of handling the 'Set' in hibernate.
本文探讨了在使用Hibernate框架进行对象关系映射时,如何处理Set集合的级联操作流程,以及在无效化Session前验证其有效性的方法。

被折叠的 条评论
为什么被折叠?



