A couple of questions.
Should adding a new child, by creating a child entity, setting the appropriate many-to-one field, and saving it (in a separate session to that which retrieved the parent) automatically update the set view in the parent object? And conversely with deletion. This doesn't seem to be occuring for me.
In a lazy one-to-many field, is there no nice way of counting the children without retrieving them all? For example I'm building a table of companies one column of which shows the number of employees I have on record. If I were doing it in SQL I'd use a COUNT function, hibernate seems to be retrieving a lot of data I probably don't need. (Also, because of the way JTable works I haven't found an alternative to openning a fresh session for every such cell).
|