did you look at the session.filter()?
are you using a list i.e. getUsers() maybe in your Role.getUsers() and you're getting empty rows? I noticed this myself in my m:m mappings, where if I delete an entity, then the cascading db constraint deletes the mapping. The net result is that the list has nulls. I think it's cause the list routine in hibernate expects everything nice and orderly in the index column with no gaps from 0 to n in the list. I am still debating the best way to deal with this. Currently, when using one of these lists, I iterate over the list and simply continue if the next element is null. I'm considering some sort of after delete trigger on the db, but I have not fully poured through the docs for a better way to get an ordered set back.
|