Quote:
>> When I use a session to load Organization, the Employee list won't load the Employees unless I "touch" it, right?
Of course.
Quote:
>> Does Hibenate load Employee proxies still? That would be bad for me because I may have literally millions of Employees.
Depends upon whether it is a one-to-many or a many-to-many. Obviously, for a one-to-many, the behavior you suggest would be absurdly inefficient. For a many-to-many it is the default behavior, which can be overridden by setting outer-join="true" on the <many-to-many> element.
Quote:
>> I would like the Employee list to remain EMPTY with no elements whatsover in it until I touch it. Is that possible?
Ummm. Of course.
Quote:
>> Now, I close the session and send the Organization further up the system to the UI, where a new Employee is added to the same Organization object instance. The Employee list should now contain exactly 1 element right? And so, I can proceed to send Organization down again and then persist the new Employee ??? <<
Negative, this behavior is not supported. The add-w/o-initialize functionalityt is only possible for a collection that is currently connected to an open session. This is a Very Good Thing. Your suggestion would be incredibly evil, since some operations of some collections would be available for uninitialized collections but most would not. I am
not going to try and support that kind of confusing, inconsistent functionality!
Quote:
>>It think it is probably worthwhile to include a special Hibernate Persistent Collections that do not necessarily adhere to the Java Collectoins API.<<<
Negative. That is contrary to the entire philosophy of the project.
If you want non-transparent-persistence, you can incredibly easily use queries instead of collections. Indeed, it is never necessary to use collections anywhere in the domain model. They are always "sugar".[/quote]